Package org.webpki.cbor
Class CBORDecrypter
java.lang.Object
org.webpki.cbor.CBORDecrypter
- Direct Known Subclasses:
CBORAsymKeyDecrypter
,CBORSymKeyDecrypter
,CBORX509Decrypter
Base class for decrypting data.
Also see 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) Decrypts data.setCustomDataPolicy
(CBORCryptoUtils.POLICY customDataPolicy, CBORCryptoUtils.Collector customDataCallBack) Sets custom extension data policy.setTagPolicy
(CBORCryptoUtils.POLICY tagPolicy, CBORCryptoUtils.Collector tagCallBack) Sets tag wrapping policy.
-
Method Details
-
setCustomDataPolicy
public CBORDecrypter setCustomDataPolicy(CBORCryptoUtils.POLICY customDataPolicy, CBORCryptoUtils.Collector customDataCallBack) Sets custom extension data policy.By default custom data elements (
CBORCryptoConstants.CUSTOM_DATA_LABEL
) are rejected (CBORCryptoUtils.POLICY.FORBIDDEN
).Also see crypto options.
- Parameters:
customDataPolicy
- Define level of supportcustomDataCallBack
- Interface for reading custom data- Returns:
this
-
setTagPolicy
public CBORDecrypter setTagPolicy(CBORCryptoUtils.POLICY tagPolicy, CBORCryptoUtils.Collector tagCallBack) Sets tag wrapping policy.By default wrapped containers are rejected (
CBORCryptoUtils.POLICY.FORBIDDEN
).Also see crypto options.
- Parameters:
tagPolicy
- Define level of supporttagCallBack
- Interface for reading tag- Returns:
this
-
decrypt
Decrypts data.This method presumes that
encryptionObject
holds an encryption object according to CEF.- Parameters:
encryptionObject
- CBOR encryption object- Returns:
- Decrypted data
-