Creates an instance of the class with a specified private key, optional expiry date, and optional blinder. This constructor initializes the public key, sets the expiry date to a default value if not provided, generates a blinder if not supplied, and calculates the nonce based on the public key, expiry date, and blinder.
The parameters for constructing the instance.
Optional
blinder?: HexInputOptional blinder value. If not provided, a new blinder will be generated.
Optional
expiryOptional expiry date in seconds from the current time. Defaults to two weeks from now.
The private key used for creating the instance.
Returns the public key of the key pair.
EphemeralPublicKey
Serializes the object's properties into a format suitable for transmission or storage. This function is essential for preparing the object data for serialization processes.
The serializer instance used to serialize the object's properties.
Sign the given data using the private key, returning an ephemeral signature. This function is essential for creating a secure signature that can be used for authentication or verification purposes.
The data to be signed, provided in HexInput format.
EphemeralSignature - The resulting ephemeral signature.
Static
deserializeDeserializes an ephemeral key pair from the provided deserializer. This function helps in reconstructing an ephemeral key pair, which is essential for cryptographic operations.
The deserializer instance used to read the serialized data.
Static
fromDeserialize a byte array into an EphemeralKeyPair object. This function allows you to reconstruct an EphemeralKeyPair from its serialized byte representation.
The byte array representing the serialized EphemeralKeyPair.
Static
generateGenerates a new ephemeral key pair with an optional expiry date. This function allows you to create a temporary key pair for secure operations.
An instance of EphemeralKeyPair containing the generated private key and expiry date.
Readonly
blinderA byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP. Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.
Readonly
expiryA timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new EphemeralKeyPair must be generated and a new JWT needs to be created.
Readonly
nonceThe value passed to the IdP when the user authenticates. It consists of a hash of the ephemeral public key, expiry date, and blinder.
Static
Readonly
BLINDER_
Represents an ephemeral key pair used for signing transactions via the Keyless authentication scheme. This key pair is temporary and includes an expiration time. For more details on how this class is used, refer to the documentation: https://aptos.dev/guides/keyless-accounts/#1-present-the-user-with-a-sign-in-with-idp-button-on-the-ui