Package org.webpki.cbor
Class CBORDecrypter<T extends CBORDecrypter<?>>
java.lang.Object
org.webpki.cbor.CBORDecrypter<T>
- Direct Known Subclasses:
CBORAsymKeyDecrypter,CBORSymKeyDecrypter,CBORX509Decrypter
Base class for decrypting data.
See also CBOREncrypter.
Note that decrypter objects may be used any number of times (assuming that the same parameters are valid). They are also thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(CBORObject encryptionObject) Decrypt data.setCustomDataPolicy(CBORCryptoUtils.POLICY customDataPolicy, CBORCryptoUtils.Collector customDataCallBack) Set custom extension data policy.setTagPolicy(CBORCryptoUtils.POLICY tagPolicy, CBORCryptoUtils.Collector tagCallBack) Set tag wrapping policy.
-
Method Details
-
setCustomDataPolicy
public T setCustomDataPolicy(CBORCryptoUtils.POLICY customDataPolicy, CBORCryptoUtils.Collector customDataCallBack) Set custom extension data policy.By default custom data elements (
CBORCryptoConstants.CXF_CUSTOM_DATA_LBL) are rejected (CBORCryptoUtils.POLICY.FORBIDDEN).See also crypto options.
- Parameters:
customDataPolicy- Define level of supportcustomDataCallBack- Interface for reading custom data- Returns:
thisof subclass
-
setTagPolicy
Set tag wrapping policy.By default wrapped containers are rejected (
CBORCryptoUtils.POLICY.FORBIDDEN).See also crypto options.
- Parameters:
tagPolicy- Define level of supporttagCallBack- Interface for reading tag- Returns:
thisof subclass
-
decrypt
Decrypt data.This method presumes that
encryptionObjectholds an encryption object according to CEF.- Parameters:
encryptionObject- CBOR encryption object- Returns:
- Decrypted data
-