Package org.webpki.cbor
Class CBORValidator<T extends CBORValidator<T>>
java.lang.Object
org.webpki.cbor.CBORValidator<T>
- Direct Known Subclasses:
CBORAsymKeyValidator
,CBORHmacValidator
,CBORX509Validator
Base class for validating signatures.
See also CBORSigner
.
Note that validator objects may be used any number of times (assuming that the same parameters are valid). They are also thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionsetCustomDataPolicy
(CBORCryptoUtils.POLICY customDataPolicy, CBORCryptoUtils.Collector customDataCollector) Sets custom data policy.setTagPolicy
(CBORCryptoUtils.POLICY tagPolicy, CBORCryptoUtils.Collector tagCollector) Sets tag wrapping policy.validate
(CBORObject key, CBORObject signedObject) Validates signed CBOR object.
-
Method Details
-
setCustomDataPolicy
public T setCustomDataPolicy(CBORCryptoUtils.POLICY customDataPolicy, CBORCryptoUtils.Collector customDataCollector) Sets custom 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 supportcustomDataCollector
- Interface for reading custom data- Returns:
this
of subclass
-
setTagPolicy
Sets tag wrapping policy.By default tagged CSF containers are rejected (
CBORCryptoUtils.POLICY.FORBIDDEN
).See also crypto options.
- Parameters:
tagPolicy
- Define level of supporttagCollector
- Interface for reading tag- Returns:
this
of subclass
-
validate
Validates signed CBOR object.This method presumes that
signedObject
holds an enveloped signature according to CSF.- Parameters:
key
- Key in map holding signaturesignedObject
- Signed CBOR object- Returns:
- The original
signedObject
-