newKey
Generates a new random symmetric key for use with the dir algorithm.
The returned EncryptionKey is an EncryptionKey.EncryptionKeyPair usable for both encryption and decryption since dir uses the same key for both operations.
Return
an EncryptionKey wrapping the generated key bytes.
Parameters
the size of the key to generate in bits. Must match the Content Encryption Algorithm's required key size (e.g. 128, 192, or 256 bits). Defaults to 256 bits.
optional key ID to associate with the generated key. Defaults to null.
Generates a new RSA-OAEP key pair for use with this algorithm.
The returned EncryptionKey is an EncryptionKey.EncryptionKeyPair containing both the public and private key, usable for encryption and decryption.
Return
an EncryptionKey wrapping the generated RSA.OAEP key pair.
Parameters
optional key ID to associate with the generated key pair. Defaults to null.
the RSA modulus size in bits. Defaults to 2048 bits.
the RSA public exponent. Defaults to 65537.
the provider used to perform key generation.
Generates a new random HMAC key for use with this algorithm.
The returned SigningKey is a SigningKey.SigningKeyPair usable for both signing and verification since HMAC uses a single symmetric key.
Return
a SigningKey wrapping the generated HMAC.Key.
Parameters
optional key ID to associate with the generated key. Defaults to null.
the provider used to perform key generation.
Generates a new RSA PKCS#1 v1.5 key pair for use with this algorithm.
The returned SigningKey is a SigningKey.SigningKeyPair containing both the public and private key, usable for signing and verification.
Return
a SigningKey wrapping the generated RSA.PKCS1 key pair.
Parameters
optional key ID to associate with the generated key pair. Defaults to null.
the RSA modulus size in bits. Defaults to 2048 bits.
the RSA public exponent. Defaults to 65537.
the provider used to perform key generation.
Generates a new RSA PSS key pair for use with this algorithm.
The returned SigningKey is a SigningKey.SigningKeyPair containing both the public and private key, usable for signing and verification.
Return
a SigningKey wrapping the generated RSA.PSS key pair.
Parameters
optional key ID to associate with the generated key pair. Defaults to null.
the RSA modulus size in bits. Defaults to 2048 bits.
the RSA public exponent. Defaults to 65537.
the provider used to perform key generation.
Generates a new ECDSA key pair for use with this algorithm.
The returned SigningKey is a SigningKey.SigningKeyPair containing both the public and private key, usable for signing and verification.
Return
a SigningKey wrapping the generated ECDSA key pair.
Parameters
optional key ID to associate with the generated key pair. Defaults to null.
the provider used to perform key generation.