public interface CryptoProviderUtil
| Modifier and Type | Method and Description |
|---|---|
PrivateKey |
convertBytesToPrivateKey(byte[] keyBytes)
Convert a byte array to an EC private key by decoding the D number
parameter.
|
PublicKey |
convertBytesToPublicKey(byte[] keyBytes)
Converts byte array to an EC public key, by decoding the Q point
parameter.
|
SecretKey |
convertBytesToSharedSecretKey(byte[] bytesSecretKey)
Converts a byte array to the secret shared key (usually used for AES
based operations).
|
byte[] |
convertPrivateKeyToBytes(PrivateKey privateKey)
Converts an EC private key to bytes by encoding the D number parameter.
|
byte[] |
convertPublicKeyToBytes(PublicKey publicKey)
Converts an EC public key to a byte array by encoding Q point parameter.
|
byte[] |
convertSharedSecretKeyToBytes(SecretKey sharedSecretKey)
Converts a shared secret key (usually used for AES based operations) to a
byte array.
|
String |
getProviderName()
Get the provider name, for example "BC" for Bouncy Castle.
|
String getProviderName()
byte[] convertPublicKeyToBytes(PublicKey publicKey) throws CryptoProviderException
publicKey - An EC public key to be converted.CryptoProviderException - In case crypto provider is not initialized correctly.PublicKey convertBytesToPublicKey(byte[] keyBytes) throws InvalidKeySpecException, CryptoProviderException
keyBytes - Bytes to be converted to EC public key.InvalidKeySpecException - When provided bytes are not a correct key
representation.CryptoProviderException - When crypto provider is incorrectly initialized.byte[] convertPrivateKeyToBytes(PrivateKey privateKey)
privateKey - An EC private key to be converted to bytes.PrivateKey convertBytesToPrivateKey(byte[] keyBytes) throws InvalidKeySpecException, CryptoProviderException
keyBytes - Bytes to be converted to the EC private key.InvalidKeySpecException - The provided key bytes are not a valid EC
private key.CryptoProviderException - When crypto provider is incorrectly initialized.byte[] convertSharedSecretKeyToBytes(SecretKey sharedSecretKey)
sharedSecretKey - A shared key to be converted to bytes.SecretKey convertBytesToSharedSecretKey(byte[] bytesSecretKey)
bytesSecretKey - Bytes representing the shared key.Copyright © 2016–2019 Wultra s.r.o.. All rights reserved.