Package org.jose4j.jwe
Class Pbes2HmacShaWithAesKeyWrapAlgorithm
java.lang.Object
org.jose4j.jwa.AlgorithmInfo
org.jose4j.jwe.Pbes2HmacShaWithAesKeyWrapAlgorithm
- All Implemented Interfaces:
Algorithm
,KeyManagementAlgorithm
- Direct Known Subclasses:
Pbes2HmacShaWithAesKeyWrapAlgorithm.HmacSha256Aes128
,Pbes2HmacShaWithAesKeyWrapAlgorithm.HmacSha384Aes192
,Pbes2HmacShaWithAesKeyWrapAlgorithm.HmacSha512Aes256
public class Pbes2HmacShaWithAesKeyWrapAlgorithm
extends AlgorithmInfo
implements KeyManagementAlgorithm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
Fields inherited from class org.jose4j.jwa.AlgorithmInfo
log
-
Constructor Summary
ConstructorsConstructorDescriptionPbes2HmacShaWithAesKeyWrapAlgorithm
(String alg, String hmacAlg, AesKeyWrapManagementAlgorithm keyWrapAlg) -
Method Summary
Modifier and TypeMethodDescriptionprotected Key
deriveForEncrypt
(Key managementKey, Headers headers, ProviderContext providerContext) long
int
boolean
manageForDecrypt
(CryptoPrimitive cryptoPrimitive, byte[] encryptedKey, ContentEncryptionKeyDescriptor cekDesc, Headers headers, ProviderContext providerContext) manageForEncrypt
(Key managementKey, ContentEncryptionKeyDescriptor cekDesc, Headers headers, byte[] cekOverride, ProviderContext providerContext) prepareForDecrypt
(Key managementKey, Headers headers, ProviderContext providerContext) void
setDefaultIterationCount
(long defaultIterationCount) void
setDefaultSaltByteLength
(int defaultSaltByteLength) void
validateDecryptionKey
(Key managementKey, ContentEncryptionAlgorithm contentEncryptionAlg) void
validateEncryptionKey
(Key managementKey, ContentEncryptionAlgorithm contentEncryptionAlg) void
validateKey
(Key managementKey) Methods inherited from class org.jose4j.jwa.AlgorithmInfo
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType, setAlgorithmIdentifier, setJavaAlgorithm, setKeyPersuasion, setKeyType, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jose4j.jwa.Algorithm
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType
-
Constructor Details
-
Pbes2HmacShaWithAesKeyWrapAlgorithm
public Pbes2HmacShaWithAesKeyWrapAlgorithm(String alg, String hmacAlg, AesKeyWrapManagementAlgorithm keyWrapAlg)
-
-
Method Details
-
manageForEncrypt
public ContentEncryptionKeys manageForEncrypt(Key managementKey, ContentEncryptionKeyDescriptor cekDesc, Headers headers, byte[] cekOverride, ProviderContext providerContext) throws JoseException - Specified by:
manageForEncrypt
in interfaceKeyManagementAlgorithm
- Throws:
JoseException
-
deriveForEncrypt
protected Key deriveForEncrypt(Key managementKey, Headers headers, ProviderContext providerContext) throws JoseException - Throws:
JoseException
-
prepareForDecrypt
public CryptoPrimitive prepareForDecrypt(Key managementKey, Headers headers, ProviderContext providerContext) throws JoseException - Specified by:
prepareForDecrypt
in interfaceKeyManagementAlgorithm
- Throws:
JoseException
-
manageForDecrypt
public Key manageForDecrypt(CryptoPrimitive cryptoPrimitive, byte[] encryptedKey, ContentEncryptionKeyDescriptor cekDesc, Headers headers, ProviderContext providerContext) throws JoseException - Specified by:
manageForDecrypt
in interfaceKeyManagementAlgorithm
- Throws:
JoseException
-
validateEncryptionKey
public void validateEncryptionKey(Key managementKey, ContentEncryptionAlgorithm contentEncryptionAlg) throws InvalidKeyException - Specified by:
validateEncryptionKey
in interfaceKeyManagementAlgorithm
- Throws:
InvalidKeyException
-
validateDecryptionKey
public void validateDecryptionKey(Key managementKey, ContentEncryptionAlgorithm contentEncryptionAlg) throws InvalidKeyException - Specified by:
validateDecryptionKey
in interfaceKeyManagementAlgorithm
- Throws:
InvalidKeyException
-
validateKey
- Throws:
InvalidKeyException
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailable
in interfaceAlgorithm
-
getDefaultIterationCount
public long getDefaultIterationCount() -
setDefaultIterationCount
public void setDefaultIterationCount(long defaultIterationCount) -
getDefaultSaltByteLength
public int getDefaultSaltByteLength() -
setDefaultSaltByteLength
public void setDefaultSaltByteLength(int defaultSaltByteLength)
-