RsaKey Class
- java.
lang. Object - Closeable
- IKey
- com.
microsoft. azure. keyvault. cryptography. RsaKey
- com.
public class RsaKey implements IKey
Field Summary
Modifier and Type | Field and Description |
---|---|
int | KeySize1024 |
int | KeySize2048 |
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
void | close() |
ListenableFuture<byte[]> |
decryptAsync(final byte[] ciphertext, final byte[] iv, final byte[] authenticationData, final byte[] authenticationTag, final String algorithm)
Decrypts the specified cipher text. Note that not all algorithms require, or support, all parameters. |
ListenableFuture<Triple<byte[], byte[], String>> |
encryptAsync(final byte[] plaintext, final byte[] iv, final byte[] authenticationData, final String algorithm)
Encrypts the specified plain text. Note that not all algorithms require, or support, all parameters. |
String |
getDefaultEncryptionAlgorithm()
The default encryption algorithm for this key, using the representations from Json Web Key Algorithms, RFC7513. |
int | getDefaultKeySize() |
String |
getDefaultKeyWrapAlgorithm()
The default key wrap algorithm for this key, using the representations from Json Web Key Algorithms, RFC7513. |
String |
getDefaultSignatureAlgorithm()
The default signature algorithm for this key, using the representations from Json Web Key Algorithms, RFC7513. |
String |
getKid()
The unique key identifier for this key. |
ListenableFuture<Pair<byte[], String>> |
signAsync(final byte[] digest, final String algorithm)
Signs the specified digest using the specified algorithm, or the keys DefaultSignatureAlgorithm if no algorithm is specified. |
ListenableFuture<byte[]> |
unwrapKeyAsync(final byte[] encryptedKey, final String algorithm)
Unwraps (decrypts) the specified encryped key material. |
ListenableFuture<Boolean> |
verifyAsync(final byte[] digest, final byte[] signature, final String algorithm)
Verifies the supplied signature value using the supplied digest and algorithm. |
ListenableFuture<Pair<byte[], String>> |
wrapKeyAsync(final byte[] key, final String algorithm)
Wraps (encrypts) the specified symmetric key material using the specified algorithm, or the keys DefaultKeyWrapAlgorithm if none is specified. |
Field Details
KeySize1024
public static int KeySize1024= 1024
KeySize2048
public static int KeySize2048= 2048
Constructor Details
RsaKey
public RsaKey(String kid)
Parameters:
RsaKey
public RsaKey(String kid, int keySize)
Parameters:
RsaKey
public RsaKey(String kid, int keySize, Provider provider)
Parameters:
RsaKey
public RsaKey(String kid, KeyPair keyPair)
Parameters:
RsaKey
public RsaKey(String kid, KeyPair keyPair, Provider provider)
Parameters:
Method Details
close
public void close()
decryptAsync
public ListenableFuture
Decrypts the specified cipher text. Note that not all algorithms require, or support, all parameters.
Overrides:
RsaKey.decryptAsync(final byte[] ciphertext, final byte[] iv, final byte[] authenticationData, final byte[] authenticationTag, final String algorithm)Parameters:
Returns:
Throws:
encryptAsync
public ListenableFuture
Encrypts the specified plain text. Note that not all algorithms require, or support, all parameters.
Overrides:
RsaKey.encryptAsync(final byte[] plaintext, final byte[] iv, final byte[] authenticationData, final String algorithm)Parameters:
Returns:
Throws:
getDefaultEncryptionAlgorithm
public String getDefaultEncryptionAlgorithm()
The default encryption algorithm for this key, using the representations from Json Web Key Algorithms, RFC7513.
Overrides:
RsaKey.getDefaultEncryptionAlgorithm()Returns:
getDefaultKeySize
public static int getDefaultKeySize()
getDefaultKeyWrapAlgorithm
public String getDefaultKeyWrapAlgorithm()
The default key wrap algorithm for this key, using the representations from Json Web Key Algorithms, RFC7513.
Overrides:
RsaKey.getDefaultKeyWrapAlgorithm()Returns:
getDefaultSignatureAlgorithm
public String getDefaultSignatureAlgorithm()
The default signature algorithm for this key, using the representations from Json Web Key Algorithms, RFC7513.
Overrides:
RsaKey.getDefaultSignatureAlgorithm()Returns:
getKid
public String getKid()
The unique key identifier for this key.
Overrides:
RsaKey.getKid()Returns:
signAsync
public ListenableFuture
Signs the specified digest using the specified algorithm, or the keys DefaultSignatureAlgorithm if no algorithm is specified.
Overrides:
RsaKey.signAsync(final byte[] digest, final String algorithm)Parameters:
Returns:
Throws:
unwrapKeyAsync
public ListenableFuture
Unwraps (decrypts) the specified encryped key material.
Overrides:
RsaKey.unwrapKeyAsync(final byte[] encryptedKey, final String algorithm)Parameters:
Returns:
Throws:
verifyAsync
public ListenableFuture
Verifies the supplied signature value using the supplied digest and algorithm.
Overrides:
RsaKey.verifyAsync(final byte[] digest, final byte[] signature, final String algorithm)Parameters:
Returns:
Throws:
wrapKeyAsync
public ListenableFuture
Wraps (encrypts) the specified symmetric key material using the specified algorithm, or the keys DefaultKeyWrapAlgorithm if none is specified.
Overrides:
RsaKey.wrapKeyAsync(final byte[] key, final String algorithm)Parameters:
Returns:
Throws:
Applies to
Azure SDK for Java