-
Notifications
You must be signed in to change notification settings - Fork 113
Architecture Principles
This page contains some loose principles that should guide the development of JOSESwift.
Logical independent components should be modular and promote reusability.
Both JWS and JWE use the same compact serializer. The compact serializer does not need detailed information about the inner structure of these objects.
Cryptographic primitives should be replaceable.
The crypto primitives of a JWS signer can be exchanged by replacing one source file.
Objects are immutable. Properties of an object need to be set during initialization or have default values. Compute derived values as needed after initializing an object.
The compact serialization of a JWS is derived from its immutable properties.
Do computations needed to construct a valid object during initialization to ensure immutability.
The signature of a JWS is computed during initialization. It is needed to construct a valid, immutable object.
Signatures are not validated when initializing a JWS from a serialization. Objects with an invalid signature are still syntactically correct objects.
Provide reasonable defaults additionally to full customizability.
There should be a default signing algorithm so users only need to specify some data to construct a JWS. See #54 and #55.