public interface IKey extends Closeable
| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.ListenableFuture<byte[]> |
decryptAsync(byte[] ciphertext,
byte[] iv,
byte[] authenticationData,
byte[] authenticationTag,
String algorithm)
Decrypts the specified cipher text.
|
com.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Triple<byte[],byte[],String>> |
encryptAsync(byte[] plaintext,
byte[] iv,
byte[] authenticationData,
String algorithm)
Encrypts the specified plain text.
|
String |
getDefaultEncryptionAlgorithm()
The default encryption algorithm for this key, using the representations
from Json Web Key Algorithms, RFC7513.
|
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.
|
com.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> |
signAsync(byte[] digest,
String algorithm)
Signs the specified digest using the specified algorithm, or the keys
DefaultSignatureAlgorithm if no algorithm is specified.
|
com.google.common.util.concurrent.ListenableFuture<byte[]> |
unwrapKeyAsync(byte[] encryptedKey,
String algorithm)
Unwraps (decrypts) the specified encryped key material.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
verifyAsync(byte[] digest,
byte[] signature,
String algorithm)
Verifies the supplied signature value using the supplied digest and
algorithm.
|
com.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> |
wrapKeyAsync(byte[] key,
String algorithm)
Wraps (encrypts) the specified symmetric key material using the specified
algorithm, or the keys DefaultKeyWrapAlgorithm if none is specified.
|
String getDefaultEncryptionAlgorithm()
String getDefaultKeyWrapAlgorithm()
String getDefaultSignatureAlgorithm()
String getKid()
com.google.common.util.concurrent.ListenableFuture<byte[]> decryptAsync(byte[] ciphertext,
byte[] iv,
byte[] authenticationData,
byte[] authenticationTag,
String algorithm)
throws NoSuchAlgorithmException
ciphertext - The cipher text to decryptiv - The initialization vector (optional with some algorithms)authenticationData - Additional authentication data (optional with some algorithms)authenticationTag - The authentication tag from the encrypt operation (optional
with some algorithms)algorithm - The encryption algorithm to use, must be suppliedNoSuchAlgorithmException - the algorithm is not validcom.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Triple<byte[],byte[],String>> encryptAsync(byte[] plaintext, byte[] iv, byte[] authenticationData, String algorithm) throws NoSuchAlgorithmException
plaintext - The plain text to encryptiv - The initialization vector (optional with some algorithms)authenticationData - Additional authentication data (optional with some algorithms)algorithm - The encryption algorithm to use, defaults to the keys
DefaultEncryptionAlgorithmNoSuchAlgorithmException - the algorithm is not validcom.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> wrapKeyAsync(byte[] key, String algorithm) throws NoSuchAlgorithmException
key - The symmetric key to wrapalgorithm - The wrapping algorithm to use, defaults to the keys
DefaultKeyWrapAlgorithmNoSuchAlgorithmException - the algorithm is not validcom.google.common.util.concurrent.ListenableFuture<byte[]> unwrapKeyAsync(byte[] encryptedKey,
String algorithm)
throws NoSuchAlgorithmException
encryptedKey - The encrypted key to decryptalgorithm - The algorithm to use, must be suppliedNoSuchAlgorithmException - the algorithm is not validcom.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> signAsync(byte[] digest, String algorithm) throws NoSuchAlgorithmException
digest - The digest to signalgorithm - The signature algorithm to useNoSuchAlgorithmException - the algorithm is not validcom.google.common.util.concurrent.ListenableFuture<Boolean> verifyAsync(byte[] digest, byte[] signature, String algorithm) throws NoSuchAlgorithmException
digest - The digest inputsignature - The signature to verifyalgorithm - The algorithm to use, must be providedNoSuchAlgorithmException - the algorithm is not valid/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/