directory-kerby mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zheng, Kai" <kai.zh...@intel.com>
Subject ASN1. Allow to register value type for Any to avoid blindly decoding when possible
Date Mon, 21 Dec 2015 23:16:58 GMT
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 <kai.zheng@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message