Package com.google.crypto.tink
Interface KeyWrap
-
- All Known Implementing Classes:
Kwp
public interface KeyWrapInterface for symmetric Key wrapping. A key wrap algorithm is a primitive specifically meant for encrypting key material. Primitives implementing the interface may either be deterministic or non-deterministic.The interface is somewhat limited. It does not allow additional data during key wrapping. The security guarantees are not including a multi user setting. The reason for these limitations is that it allows to include KWP, with the plan to allow rotation to other algorithms.
Requirements
Primitives implementing use key sizes of 128-bits or higher. Key wrapping includes an integrity check. The minimal strength of the integrity check is about 64 bits. In particular, the minimal key strength allows KWP to be included.Key size of the wrapped key.
Valid key sizes are in the range 16 .. 4096 bytes. The lower bound assures a low probability of key collisions, and hence allows deterministic key wrappings to be used.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]unwrap(byte[] data)Unwraps a wrapped key.byte[]wrap(byte[] data)Wraps some key materialdata.
-
-
-
Method Detail
-
wrap
byte[] wrap(byte[] data) throws java.security.GeneralSecurityExceptionWraps some key materialdata.- Parameters:
data- the key to wrap.- Returns:
- the wrapped key
- Throws:
java.security.GeneralSecurityException
-
unwrap
byte[] unwrap(byte[] data) throws java.security.GeneralSecurityExceptionUnwraps a wrapped key.- Throws:
java.security.GeneralSecurityException- ifdatafails the integrity check.
-
-