public final class ConstructKeys extends Object
| 构造器和说明 |
|---|
ConstructKeys() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Key |
constructKey(byte[] encoding,
String keyAlgorithm,
int keyType) |
static PrivateKey |
constructPrivateKey(byte[] encodedKey,
String encodedKeyAlgorithm)
Construct a private key from its encoding.
|
static PublicKey |
constructPublicKey(byte[] encodedKey,
String encodedKeyAlgorithm)
Construct a public key from its encoding.
|
private static SecretKey |
constructSecretKey(byte[] encodedKey,
String encodedKeyAlgorithm)
Construct a secret key from its encoding.
|
public static final PublicKey constructPublicKey(byte[] encodedKey, String encodedKeyAlgorithm) throws InvalidKeyException, NoSuchAlgorithmException
encodedKey - the encoding of a public key.encodedKeyAlgorithm - the algorithm the encodedKey is for.InvalidKeyExceptionNoSuchAlgorithmExceptionpublic static final PrivateKey constructPrivateKey(byte[] encodedKey, String encodedKeyAlgorithm) throws InvalidKeyException, NoSuchAlgorithmException
encodedKey - the encoding of a private key.encodedKeyAlgorithm - the algorithm the wrapped key is for.InvalidKeyExceptionNoSuchAlgorithmExceptionprivate static final SecretKey constructSecretKey(byte[] encodedKey, String encodedKeyAlgorithm)
encodedKey - the encoding of a secret key.encodedKeyAlgorithm - the algorithm the secret key is for.public static final Key constructKey(byte[] encoding, String keyAlgorithm, int keyType) throws InvalidKeyException, NoSuchAlgorithmException
Copyright © 2024. All rights reserved.