TrustCore SDK NanoCert API reference  version 7.0
Attribute Struct Reference

Information about an attribute of a SignedData object. More...

Data Fields

ubyte4 type
 
const ubyte * typeOID
 
ubyte * value
 
ubyte4 valueLen
 

Detailed Description

This structure contains information about an attribute of a SignedData object.

For the typeOID field, specify any of the following preconfigured PKCS #9 attribute constant arrays from src/asn1/oiddefs.h:

  • pkcs9_emailAddress_OID
  • pkcs9_contentType_OID
  • pkcs9_messageDigest_OID
  • pkcs9_signingTime_OID
  • pkcs9_challengePassword_OID
  • pkcs9_extensionRequest_OID

(is the given list of pkcs9_* constants complete? there are more in oiddefs.h...)

Example
To populate an Attribute structure to store an email address, you could use code similar to the following snippet:

pAuthAttributes = (Attribute *)MALLOC(sizeof(Attribute)*authAttributeLen);
if (!pAuthAttributes)
{
status = ERR_MEM_ALLOC_FAIL;
goto exit;
}
pAuthAttributes->typeOID = pkcs9_emailAddress_OID;
pAuthAttributes->type = PRINTABLESTRING;
pAuthAttributes->value = "nobody@mocana.com";
pAuthAttributes->valueLen = 17;

The documentation for this struct was generated from the following file: