Tagged and Custom Container Data

The CBOR library contains support for wrapping CSF and CEF containers in a CBORTag as well as including a custom data element.

In both cases the added information becomes a part of the authenticated (signed) data.

Creating Tagged Containers

Creating a tagged CSF or CEF container is performed by calling CBORSigner.setIntercepter(CBORCryptoUtils.Intercepter) and CBOREncrypter.setIntercepter(CBORCryptoUtils.Intercepter) respectively, where CBORCryptoUtils.Intercepter.wrap(CBORMap) is supposed to do the actual wrapping.

Decoding Tagged Containers

Decoding the tag of a tagged CSF or CEF container is performed by calling CBORValidator.setTagPolicy(CBORCryptoUtils.POLICY,CBORCryptoUtils.Collector) and CBORDecrypter.setTagPolicy(CBORCryptoUtils.POLICY,CBORCryptoUtils.Collector) respectively, where CBORCryptoUtils.Collector.foundData(CBORObject) returns the actual tag object or null if the container is not tagged.

Creating Custom Data

Adding custom data to CSF or CEF containers is performed by calling CBORSigner.setIntercepter(CBORCryptoUtils.Intercepter) and CBOREncrypter.setIntercepter(CBORCryptoUtils.Intercepter) respectively, where CBORCryptoUtils.Intercepter.getCustomData() is supposed to provide the actual data.

Decoding Custom Data

Decoding custom data in a CSF or CEF container is performed by calling CBORValidator.setCustomDataPolicy(CBORCryptoUtils.POLICY,CBORCryptoUtils.Collector) and CBORDecrypter.setCustomDataPolicy(CBORCryptoUtils.POLICY,CBORCryptoUtils.Collector) respectively, where CBORCryptoUtils.Collector.foundData(CBORObject) returns the actual data or null if the container does not contain such data.