public class CryptoProviderUtilsSpongyCastle extends Object implements CryptoProviderUtil
| Constructor and Description |
|---|
CryptoProviderUtilsSpongyCastle() |
| 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.
|
public String getProviderName()
getProviderName in interface CryptoProviderUtilpublic byte[] convertPublicKeyToBytes(PublicKey publicKey)
convertPublicKeyToBytes in interface CryptoProviderUtilpublicKey - An EC public key to be converted.public PublicKey convertBytesToPublicKey(byte[] keyBytes) throws InvalidKeySpecException
convertBytesToPublicKey in interface CryptoProviderUtilkeyBytes - Bytes to be converted to EC public key.InvalidKeySpecException - When provided bytes are not a correct key
representation.public byte[] convertPrivateKeyToBytes(PrivateKey privateKey)
convertPrivateKeyToBytes in interface CryptoProviderUtilprivateKey - An EC private key to be converted to bytes.public PrivateKey convertBytesToPrivateKey(byte[] keyBytes) throws InvalidKeySpecException
convertBytesToPrivateKey in interface CryptoProviderUtilkeyBytes - Bytes to be converted to the EC private key.InvalidKeySpecException - The provided key bytes are not a valid EC
private key.public byte[] convertSharedSecretKeyToBytes(SecretKey sharedSecretKey)
convertSharedSecretKeyToBytes in interface CryptoProviderUtilsharedSecretKey - A shared key to be converted to bytes.public SecretKey convertBytesToSharedSecretKey(byte[] bytesSecretKey)
convertBytesToSharedSecretKey in interface CryptoProviderUtilbytesSecretKey - Bytes representing the shared key.Copyright © 2016 Lime - HighTech Solutions Inc.. All rights reserved.