JweHeader class
Represents the protected header of a JWE (JSON Web Encryption) message in DIDComm.
This header contains all cryptographic parameters required for decryption and verification of a DIDComm-encrypted message, as defined in the DIDComm Messaging specification.
Fields such as skid, alg, enc, epk, apu, and apv are critical for ECDH-1PU and ECDH-ES
key agreement, and their values must be constructed and validated according to the spec.
- Annotations
-
- @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
Constructors
- JweHeader({String type = 'application/didcomm-encrypted+json', String? subjectKeyId, required KeyWrappingAlgorithm keyWrappingAlgorithm, required EncryptionAlgorithm encryptionAlgorithm, required EphemeralKey ephemeralKey, String? agreementPartyUInfo, required String? agreementPartyVInfo})
- Constructs a JweHeader with the given parameters.
-
JweHeader.fromJson(Map<
String, dynamic> json) -
Deserializes a JweHeader from JSON.
factory
Properties
- agreementPartyUInfo → String?
-
Agreement PartyUInfo (apu), base64url-encoded sender key ID for ECDH-1PU.
See: https://identity.foundation/didcomm-messaging/spec/#ecdh-1pu-key-wrapping-and-common-protected-headers
final
- agreementPartyVInfo → String?
-
Agreement PartyVInfo (apv), base64url-encoded hash of recipient key IDs.
See: https://identity.foundation/didcomm-messaging/spec/#ecdh-1pu-key-wrapping-and-common-protected-headers
and https://identity.foundation/didcomm-messaging/spec/#ecdh-es-key-wrapping-and-common-protected-headers
final
- encryptionAlgorithm → EncryptionAlgorithm
-
The content encryption algorithm (enc) used for encrypting the payload.
See: https://identity.foundation/didcomm-messaging/spec/#curves-and-content-encryption-algorithms
final
- ephemeralKey → EphemeralKey
-
The ephemeral public key (epk) used in key agreement.
See: https://identity.foundation/didcomm-messaging/spec/#ecdh-1pu-key-wrapping-and-common-protected-headers
and https://identity.foundation/didcomm-messaging/spec/#ecdh-es-key-wrapping-and-common-protected-headers
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- keyWrappingAlgorithm → KeyWrappingAlgorithm
-
The key wrapping algorithm (alg) used for encrypting the content encryption key.
See: https://identity.foundation/didcomm-messaging/spec/#key-wrapping-algorithms
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subjectKeyId → String?
-
The subject key identifier (skid), used for ECDH-1PU key agreement.
See: https://identity.foundation/didcomm-messaging/spec/#key-ids
final
- type → String
-
The type of the JWE message. Defaults to 'application/didcomm-encrypted+json'.
See: https://identity.foundation/didcomm-messaging/spec/#iana-media-types
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes this JweHeader to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromKeyType(
KeyType keyType, {String? subjectKeyId, required List< DidDocument> recipientDidDocuments, required Uint8List ephemeralPrivateKeyBytes, Uint8List? ephemeralPublicKeyBytes, required KeyWrappingAlgorithm keyWrappingAlgorithm, required EncryptionAlgorithm encryptionAlgorithm}) → Future<JweHeader> - Creates a JweHeader from a key type and encryption parameters.