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 <[email protected]>
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

Reply via email to