PackageKey class
One public key advertised in a KeyPackage.
kid is a short identifier for the key (a SHA-256 prefix of pub) which envelopes use to say which of the recipient's keys was used. alg is an algorithm id from SecretSharingAlgos; readers skip entries whose alg or use they do not recognise, which is what lets a key package advertise new suites without breaking old readers.
- Annotations
-
- @experimental
Constructors
- PackageKey({required String use, required String alg, required String pub, String? kid, KeyEntryStatus status = KeyEntryStatus.active})
- PackageKey.fromBytes({required String use, required String alg, required Uint8List pub, KeyEntryStatus status = KeyEntryStatus.active})
- A key held as raw material rather than as the base64 an advertisement carries — what a freshly minted KEM keypair hands back.
Properties
- alg → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- kid → String
-
final
- offeredForNewOperations → bool
-
Whether a sender may seal to this key — see
KeyEntryStatus.offersNewOperations. A holder deciding whether it can
open an envelope already addressed here does not ask: a retired key
is retained precisely so that it still opens what was sealed to it.
no setter
- pub → String
-
final
- pubBytes → Uint8List
-
The key material pub encodes.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → KeyEntryStatus
-
Whether this key is still offered for new operations — an open token,
see KeyEntryStatus.
final
- use → String
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
statusis omitted for an active key, because its absence already means KeyEntryStatus.active. Whatever token was read is emitted unchanged, so that republishing a record cannot weaken what its owner said about a key. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
computeKid(
String pub) → String -
First 8 bytes, hex-encoded, of the SHA-256 of the public key material,
for a
pubheld as base64 — which is how a key package carries one. -
fromJson(
Object? json) → PackageKey?