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.setMultiSignatureMode
(boolean flag) Set multiple signature mode.setTagPolicy
(CBORCryptoUtils.POLICY tagPolicy, CBORCryptoUtils.Collector tagCollector) Sets tag wrapping policy.validate
(CBORObject signedObject) Validates signed CBOR object.
-
Method Details
-
setMultiSignatureMode
Set multiple signature mode.By default the
validate(CBORObject)
method assumes single signature mode.- Parameters:
flag
- Iftrue
multiple signature mode is assumed- Returns:
this
of subclass
-
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 embedded signature according to CSF.- Parameters:
signedObject
- Signed CBOR object- Returns:
- The original
signedObject
-