Class CBORValidator<T extends CBORValidator<T>>
- Direct Known Subclasses:
CBORAsymKeyValidator,CBORHmacValidator,CBORX509Validator
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.Sets unprotected data 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- Iftruemultiple signature mode is assumed- Returns:
thisof 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:
thisof 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:
thisof subclass
-
setUnprotectedDataPolicy
Sets unprotected data policy.Unprotected data is indicated by the reserved label
CBORCryptoConstants.CSF_UNPROTECTED_LBL.By default unprotected data is rejected (
CBORCryptoUtils.POLICY.FORBIDDEN).- Parameters:
policy- Define level of support- Returns:
thisof subclass
-
validate
Validates signed CBOR object.This method presumes that
signedObjectholds an embedded signature according to CSF.- Parameters:
signedObject- Signed CBOR object- Returns:
- The original
signedObject
-