You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kerby@directory.apache.org by "Zheng, Kai" <ka...@intel.com> on 2015/12/22 00:16:58 UTC

ASN1. Allow to register value type for Any to avoid blindly decoding when possible

Hi Jiajia and all,

Please check out the following commit. This will avoid blinding decoding of Any type and improve performance since it allows to specify the user defined value type for the Any container.
Additionally, for the CMS generic ContentInfo container that uses Any for the content part, a further wrapper is encouraged and the value type can be specified in the wrapper elegantly.

A sample:

/**
* A ContentInfo that wraps SignedData.
*/
public class SignedContentInfo extends ContentInfo {

    public SignedContentInfo() {
        super();
        setAnyFieldValueType(CONTENT, SignedData.class);
    }

    public SignedData getSignedData() {
        return getFieldAsAny(CONTENT, SignedData.class);
    }

    public void setSignedData(SignedData signedData) {
        setFieldAsAny(CONTENT, signedData);
    }
}


commit d9030f64830dd096a16b0abf814260a3c5780fae
Author: Kai Zheng <ka...@intel.com>
Date:   Tue Dec 22 07:06:01 2015 +0800

   ASN1. Allow to register value type for Any to avoid blindly decoding when possible

Regards,
Kai