public interface IKey extends Closeable
| Modifier and Type | Method and Description |
|---|---|
Future<byte[]> |
decryptAsync(byte[] ciphertext,
byte[] iv,
byte[] authenticationData,
byte[] authenticationTag,
String algorithm)
Decrypts the specified cipher text.
|
Future<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.
|
Future<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.
|
Future<byte[]> |
unwrapKeyAsync(byte[] encryptedKey,
String algorithm)
Unwraps (decrypts) the specified encryped key material.
|
Future<Boolean> |
verifyAsync(byte[] digest,
byte[] signature,
String algorithm)
Verifies the supplied signature value using the supplied digest and
algorithm.
|
Future<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()
Future<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 suppliedNoSuchAlgorithmExceptionFuture<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
DefaultEncryptionAlgorithmNoSuchAlgorithmExceptionFuture<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
DefaultKeyWrapAlgorithmNoSuchAlgorithmExceptionFuture<byte[]> unwrapKeyAsync(byte[] encryptedKey, String algorithm) throws NoSuchAlgorithmException
encryptedKey - The encrypted key to decryptalgorithm - The algorithm to use, must be suppliedNoSuchAlgorithmExceptionFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> signAsync(byte[] digest, String algorithm)
digest - The digest to signalgorithm - The signature algorithm to useFuture<Boolean> verifyAsync(byte[] digest, byte[] signature, String algorithm)
digest - The digest inputsignature - The signature to verifyalgorithm - The algorithm to use, must be provided/**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/