Interface GordianKeySet
public interface GordianKeySet
keySet API.
-
Method Summary
Modifier and TypeMethodDescriptioncloneIt()Clone the keySet.Create a keySetAADCipher.Create a keySetCipher.default byte[]decryptAADBytes(byte[] pBytesToDecrypt) Decrypt AAD bytes.byte[]decryptAADBytes(byte[] pBytesToDecrypt, byte[] pAAD) Decrypt AAD bytes.byte[]decryptBytes(byte[] pBytesToDecrypt) Decrypt bytes.byte[]deriveBytes(byte[] pSecuredBytes) derive bytes.<T extends GordianKeySpec>
GordianKey<T> deriveKey(byte[] pSecuredKey, T pKeyType) derive Key.deriveKeyPair(X509EncodedKeySpec pPublicKeySpec, byte[] pSecuredPrivateKey) derive keyPair.deriveKeySet(byte[] pSecuredKeySet) derive KeySet.default byte[]encryptAADBytes(byte[] pBytesToEncrypt) Encrypt AAD bytes.byte[]encryptAADBytes(byte[] pBytesToEncrypt, byte[] pAAD) Encrypt AAD bytes.byte[]encryptBytes(byte[] pBytesToEncrypt) Encrypt bytes.Obtain the keySetSpec.intObtain the keySet wrap length.intgetKeyWrapLength(GordianLength pKeyLen) Obtain wrapped size of a key.intgetPrivateKeyWrapLength(GordianKeyPair pKeyPair) Obtain wrapped size of the privateKey of a keyPair.byte[]secureBytes(byte[] pBytesToSecure) secure bytes.byte[]secureKey(GordianKey<?> pKeyToSecure) secure Key.byte[]secureKeySet(GordianKeySet pKeySetToSecure) secure KeySet.byte[]securePrivateKey(GordianKeyPair pKeyPair) secure privateKey.
-
Method Details
-
getKeySetSpec
GordianKeySetSpec getKeySetSpec()Obtain the keySetSpec.- Returns:
- the keySetSpec
-
createCipher
Create a keySetCipher.- Returns:
- the keySetCipher
- Throws:
GordianException- on error
-
encryptBytes
Encrypt bytes.- Parameters:
pBytesToEncrypt- the bytes to encrypt- Returns:
- the encrypted bytes
- Throws:
GordianException- on error
-
decryptBytes
Decrypt bytes.- Parameters:
pBytesToDecrypt- the bytes to decrypt- Returns:
- the decrypted bytes
- Throws:
GordianException- on error
-
createAADCipher
Create a keySetAADCipher.- Returns:
- the keySetCipher
- Throws:
GordianException- on error
-
encryptAADBytes
Encrypt AAD bytes.- Parameters:
pBytesToEncrypt- the bytes to encrypt- Returns:
- the encrypted bytes
- Throws:
GordianException- on error
-
encryptAADBytes
Encrypt AAD bytes.- Parameters:
pBytesToEncrypt- the bytes to encryptpAAD- the AAD data- Returns:
- the encrypted bytes
- Throws:
GordianException- on error
-
decryptAADBytes
Decrypt AAD bytes.- Parameters:
pBytesToDecrypt- the bytes to decrypt- Returns:
- the decrypted bytes
- Throws:
GordianException- on error
-
decryptAADBytes
Decrypt AAD bytes.- Parameters:
pBytesToDecrypt- the bytes to decryptpAAD- the AAD data- Returns:
- the decrypted bytes
- Throws:
GordianException- on error
-
secureKeySet
secure KeySet.- Parameters:
pKeySetToSecure- the keySet to secure- Returns:
- the encryptedKeySet
- Throws:
GordianException- on error
-
deriveKeySet
derive KeySet.- Parameters:
pSecuredKeySet- the secured keySet- Returns:
- the decrypted keySet
- Throws:
GordianException- on error
-
secureBytes
secure bytes.- Parameters:
pBytesToSecure- the bytes to secure- Returns:
- the securedBytes
- Throws:
GordianException- on error
-
deriveBytes
derive bytes.- Parameters:
pSecuredBytes- the secured bytes- Returns:
- the derivedBytes
- Throws:
GordianException- on error
-
secureKey
secure Key.- Parameters:
pKeyToSecure- the key to secure- Returns:
- the securedKey
- Throws:
GordianException- on error
-
deriveKey
<T extends GordianKeySpec> GordianKey<T> deriveKey(byte[] pSecuredKey, T pKeyType) throws GordianException derive Key.- Type Parameters:
T- the keyType class- Parameters:
pSecuredKey- the secured keypKeyType- the key type- Returns:
- the derived key
- Throws:
GordianException- on error
-
securePrivateKey
secure privateKey.- Parameters:
pKeyPair- the keyPair to secure- Returns:
- the securedPrivateKey
- Throws:
GordianException- on error
-
deriveKeyPair
GordianKeyPair deriveKeyPair(X509EncodedKeySpec pPublicKeySpec, byte[] pSecuredPrivateKey) throws GordianException derive keyPair.- Parameters:
pPublicKeySpec- the publicKeySpecpSecuredPrivateKey- the secured privateKey- Returns:
- the keyPair
- Throws:
GordianException- on error
-
getKeyWrapLength
Obtain wrapped size of a key.- Parameters:
pKeyLen- the keyLength- Returns:
- the wrapped length
-
getPrivateKeyWrapLength
Obtain wrapped size of the privateKey of a keyPair.- Parameters:
pKeyPair- the keyPair- Returns:
- the wrapped length
- Throws:
GordianException- on error
-
getKeySetWrapLength
int getKeySetWrapLength()Obtain the keySet wrap length.- Returns:
- the length
-
cloneIt
Clone the keySet.- Returns:
- the cloned keySet
- Throws:
GordianException- on error
-