public class ExtendedDecrypter extends Decrypter
Decrypter
implementation that handles the problem that when using the SunPKCS11
crypto provider the OAEPPadding does not work. This implementation supplies an workaround for this problem.
See this post on Stack overflow.
Constructor and Description |
---|
ExtendedDecrypter(DecryptionParameters params)
Constructor.
|
ExtendedDecrypter(KeyInfoCredentialResolver newResolver,
KeyInfoCredentialResolver newKEKResolver,
EncryptedKeyResolver newEncKeyResolver)
Constructor.
|
ExtendedDecrypter(KeyInfoCredentialResolver newResolver,
KeyInfoCredentialResolver newKEKResolver,
EncryptedKeyResolver newEncKeyResolver,
Collection<String> whitelistAlgos,
Collection<String> blacklistAlgos)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Key |
decryptKey(EncryptedKey encryptedKey,
String algorithm,
Key kek)
Overrides the
Decrypter.decryptKey(EncryptedKey, String, Key) so that we may handle the unsupported
features of the SunPKCS11 provider. |
void |
init()
Init method for setting key size ...
|
void |
setTestMode(boolean testMode)
Should we run this class in test mode?
|
buildParserPool, checkAndMarshall, decryptData, decryptData, decryptDataToDOM, decryptDataToDOM, decryptDataToList, decryptDataToList, decryptKey, getJCAProviderName, getKEKResolverCriteria, getKeyResolverCriteria, isRootInNewDocument, preProcessEncryptedKey, setJCAProviderName, setKEKResolverCriteria, setKeyResolverCriteria, setRootInNewDocument, validateAlgorithms, validateAlgorithms, validateAlgorithmURI
public ExtendedDecrypter(DecryptionParameters params)
params
- decryption parameters to usepublic ExtendedDecrypter(KeyInfoCredentialResolver newResolver, KeyInfoCredentialResolver newKEKResolver, EncryptedKeyResolver newEncKeyResolver)
newResolver
- resolver for data encryption keys.newKEKResolver
- resolver for key encryption keys.newEncKeyResolver
- resolver for EncryptedKey elementspublic ExtendedDecrypter(KeyInfoCredentialResolver newResolver, KeyInfoCredentialResolver newKEKResolver, EncryptedKeyResolver newEncKeyResolver, Collection<String> whitelistAlgos, Collection<String> blacklistAlgos)
newResolver
- resolver for data encryption keys.newKEKResolver
- resolver for key encryption keys.newEncKeyResolver
- resolver for EncryptedKey elementswhitelistAlgos
- collection of whitelisted algorithm URIsblacklistAlgos
- collection of blacklisted algorithm URIspublic void init()
public Key decryptKey(EncryptedKey encryptedKey, String algorithm, Key kek) throws DecryptionException
Decrypter.decryptKey(EncryptedKey, String, Key)
so that we may handle the unsupported
features of the SunPKCS11 provider.decryptKey
in class Decrypter
DecryptionException
public void setTestMode(boolean testMode)
testMode
- test mode flagCopyright © 2018 Litsec AB. All rights reserved.