KeyPair class
Holds a key pair (private and public key)
Constructors
- KeyPair({required PublicKey? publicKey, required PrivateKey? privateKey})
- Creates a KeyPair from a public and private key
-
KeyPair.fromJwk(Map<
String, dynamic> jwk) -
Create a key pair from a JsonWebKey
factory
- KeyPair.generateEc(Identifier curve)
-
factory
- KeyPair.generateRsa({BigInt? exponent, int bitStrength = 2048})
-
factory
- KeyPair.generateSymmetric(int bitLength)
-
Generates a random symmetric KeyPair with specified bit length
factory
- KeyPair.symmetric(SymmetricKey key)
- Creates a KeyPair from a symmetric key
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- privateKey → PrivateKey?
-
The private key
final
- publicKey → PublicKey?
-
The public key
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createSigner(
Identifier algorithm) → Signer< PrivateKey> - Creates a Signer using the private key and the specified algorithm.
-
createVerifier(
Identifier algorithm) → Verifier< PublicKey> - Creates a signature Verifier using the public key and the specified algorithm
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited