Interface GordianWrapper
public interface GordianWrapper
GordianKnot base for Wrap Cipher.
-
Method Summary
Modifier and TypeMethodDescriptiondefault byte[]deriveBytes(byte[] pSecuredBytes) derive bytes.byte[]deriveBytes(byte[] pSecuredBytes, int pOffset) derive bytes.<T extends GordianKeySpec>
GordianKey<T> deriveKey(byte[] pSecuredKey, T pKeyType) Derive key from bytes.deriveKeyPair(X509EncodedKeySpec pPublicKeySpec, byte[] pSecuredPrivateKey) Derive the keyPair from the PKCS8/X509 encodings.intgetDataWrapLength(int pDataLength) Obtain wrapped size of a byte array of the given length.Obtain the keyType.intgetKeyWrapLength(GordianKey<?> pKey) 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[]securePrivateKey(GordianKeyPair pKeyPair) Secure privateKey.
-
Method Details
-
getKeySpec
GordianSymKeySpec getKeySpec()Obtain the keyType.- Returns:
- the keyType
-
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 from bytes.- Type Parameters:
T- type of key to be derived- Parameters:
pSecuredKey- the securedKeypKeyType- the type of key to be derived- 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 the keyPair from the PKCS8/X509 encodings.- Parameters:
pPublicKeySpec- the publicKeySpecpSecuredPrivateKey- the secured privateKey- Returns:
- the derived keyPair
- 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
-
deriveBytes
derive bytes.- Parameters:
pSecuredBytes- the secured bytespOffset- the offset within the secured bytes- Returns:
- the derivedBytes
- Throws:
GordianException- on error
-
getKeyWrapLength
Obtain wrapped size of a key.- Parameters:
pKey- the keyToWrap- Returns:
- the wrapped length
-
getDataWrapLength
int getDataWrapLength(int pDataLength) Obtain wrapped size of a byte array of the given length.- Parameters:
pDataLength- the length of the byte array- 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
-