org.ccnx.ccn.impl.security.crypto.jce.AESWrapWithPad Class Reference
Engine wrapper around RFC3394WrapWithPadEngine, which as part of a signed Provider will let it be used via the JCE crypto interfaces.
More...
List of all members.
Public Member Functions |
byte[] | wrap (Key wrappingKey, Key keyToBeWrapped) throws InvalidKeyException, IllegalBlockSizeException |
| Temporarily expose internal wrapping functions till can make this a provider.
|
Key | unwrap (Key wrappingKey, byte[] wrappedKey, String wrappedKeyAlgorithm) throws InvalidKeyException, NoSuchAlgorithmException |
| Temporarily expose internal unwrapping functions till can make this a provider.
|
Protected Attributes |
SecureRandom | _random = new SecureRandom() |
Detailed Description
Engine wrapper around RFC3394WrapWithPadEngine, which as part of a signed Provider will let it be used via the JCE crypto interfaces.
In the short term, expose the wrap and unwrap functionality directly to allow it to be used without having to be signed.
Member Function Documentation
Key org.ccnx.ccn.impl.security.crypto.jce.AESWrapWithPad.unwrap |
( |
Key |
wrappingKey, |
|
|
byte[] |
wrappedKey, |
|
|
String |
wrappedKeyAlgorithm | |
|
) |
| | throws InvalidKeyException, NoSuchAlgorithmException |
Temporarily expose internal unwrapping functions till can make this a provider.
- Parameters:
-
| wrappingKey | key to use to wrap another key |
| wrappedKey | key to be unwrapped |
| wrappedKeyAlgorithm | algorithm to decode wrappedKey into a key for |
- Returns:
- the unwrapped key
- Exceptions:
-
| InvalidKeyException | if the wrappingKey is invalid |
| NoSuchAlgorithmException | if the wrappedKeyAlgorithm is unknown. Thrown only in older versions of BouncyCastle, here for compatibility. (Later versions catch it and rethrow as an InvalidKeyException, which we do upstream from here. Can't do it here or we'd hit an unthrown exception error when running against newer BouncyCastle libraries.) |
byte [] org.ccnx.ccn.impl.security.crypto.jce.AESWrapWithPad.wrap |
( |
Key |
wrappingKey, |
|
|
Key |
keyToBeWrapped | |
|
) |
| | throws InvalidKeyException, IllegalBlockSizeException |
Temporarily expose internal wrapping functions till can make this a provider.
- Parameters:
-
| wrappingKey | key to use to wrap another key |
| keyToBeWrapped | key to be wrapped |
- Returns:
- the wrapped key
- Exceptions:
-
| IllegalBlockSizeException | if the wrapped key or its padded version does not match the block size of the ciphar |
| InvalidKeyException | if the wrappingKey is invalid |
The documentation for this class was generated from the following file:
- src/org/ccnx/ccn/impl/security/crypto/jce/AESWrapWithPad.java