public class RsaKey extends Object implements IKey
| Modifier and Type | Field and Description |
|---|---|
static int |
KeySize1024 |
static int |
KeySize2048 |
| Constructor and Description |
|---|
RsaKey(String kid) |
RsaKey(String kid,
int keySize) |
RsaKey(String kid,
int keySize,
Provider provider) |
RsaKey(String kid,
KeyPair keyPair) |
RsaKey(String kid,
KeyPair keyPair,
Provider provider) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
com.google.common.util.concurrent.ListenableFuture<byte[]> |
decryptAsync(byte[] ciphertext,
byte[] iv,
byte[] authenticationData,
byte[] authenticationTag,
String algorithm) |
com.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Triple<byte[],byte[],String>> |
encryptAsync(byte[] plaintext,
byte[] iv,
byte[] authenticationData,
String algorithm) |
String |
getDefaultEncryptionAlgorithm() |
static int |
getDefaultKeySize() |
String |
getDefaultKeyWrapAlgorithm() |
String |
getDefaultSignatureAlgorithm() |
String |
getKid() |
com.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> |
signAsync(byte[] digest,
String algorithm) |
com.google.common.util.concurrent.ListenableFuture<byte[]> |
unwrapKeyAsync(byte[] encryptedKey,
String algorithm) |
com.google.common.util.concurrent.ListenableFuture<Boolean> |
verifyAsync(byte[] digest,
byte[] signature,
String algorithm) |
com.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> |
wrapKeyAsync(byte[] key,
String algorithm) |
public RsaKey(String kid) throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic RsaKey(String kid, int keySize) throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic RsaKey(String kid, int keySize, Provider provider) throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic static int getDefaultKeySize()
public String getDefaultEncryptionAlgorithm()
getDefaultEncryptionAlgorithm in interface IKeypublic String getDefaultKeyWrapAlgorithm()
getDefaultKeyWrapAlgorithm in interface IKeypublic String getDefaultSignatureAlgorithm()
getDefaultSignatureAlgorithm in interface IKeypublic com.google.common.util.concurrent.ListenableFuture<byte[]> decryptAsync(byte[] ciphertext,
byte[] iv,
byte[] authenticationData,
byte[] authenticationTag,
String algorithm)
throws NoSuchAlgorithmException
decryptAsync in interface IKeyNoSuchAlgorithmExceptionpublic com.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
encryptAsync in interface IKeyNoSuchAlgorithmExceptionpublic com.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> wrapKeyAsync(byte[] key, String algorithm) throws NoSuchAlgorithmException
wrapKeyAsync in interface IKeyNoSuchAlgorithmExceptionpublic com.google.common.util.concurrent.ListenableFuture<byte[]> unwrapKeyAsync(byte[] encryptedKey,
String algorithm)
throws NoSuchAlgorithmException
unwrapKeyAsync in interface IKeyNoSuchAlgorithmExceptionpublic com.google.common.util.concurrent.ListenableFuture<org.apache.commons.lang3.tuple.Pair<byte[],String>> signAsync(byte[] digest, String algorithm) throws NoSuchAlgorithmException
signAsync in interface IKeyNoSuchAlgorithmExceptionpublic com.google.common.util.concurrent.ListenableFuture<Boolean> verifyAsync(byte[] digest, byte[] signature, String algorithm) throws NoSuchAlgorithmException
verifyAsync in interface IKeyNoSuchAlgorithmExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/