TrustCore SDK NanoCert API reference  version 7.0
nameAttr Struct Reference

Certificate generation support for constructing an AttributeTypeAndValues ASN.1 object. More...

Data Fields

const ubyte * oid
 AttributeType: attribute's OID (object identifier). More...
 
ubyte type
 (Optional) DirectoryString CHOICE for the value field, such as UTF8String. More...
 
ubyte * value
 (Optional) String containing information applicable to the oid field. More...
 
ubyte4 valueLen
 Number of bytes in the name value buffer (value). More...
 

Detailed Description

This structure provides backward compatability with earlier Digicert SoT Platform certificate generation and authentication functions. The structure is a container for constructing an AttributeTypeAndValues ASN.1 object, defined as:

AttributeTypeAndValue ::= SEQUENCE {
     type     AttributeType,
     value    AttributeValue }
   AttributeType ::= OBJECT IDENTIFIER
   AttributeValue ::= ANY DEFINED BY AttributeType
   DirectoryString ::= CHOICE {
         teletexString           TeletexString (SIZE (1..MAX)),
         printableString         PrintableString (SIZE (1..MAX)),
         universalString         UniversalString (SIZE (1..MAX)),
         utf8String              UTF8String (SIZE (1..MAX)),
         bmpString               BMPString (SIZE (1..MAX)) }

This example shows how you could populate a nameAttr strucutre to define a RelativeDistinguisedName:

nameAttr pNames1[] = {
    { countryName_OID,            UTF8STRING, (ubyte*)"US",                    2}};  // country
nameAttr pNames2[] = {
    { stateOrProvinceName_OID,    UTF8STRING, (ubyte*)"California",           10}};  // state or province
nameAttr pNames3[] = {
    { localityName_OID,           UTF8STRING, (ubyte*)"San Francisco",        10}};  // locality
nameAttr pNames4[] = {
    { organizationName_OID,       UTF8STRING, (ubyte*)"Digicert Corporation",   18}};  // company name
nameAttr pNames5[] = {
    { organizationalUnitName_OID, UTF8STRING, (ubyte*)"Engineering",          11}};  // organizational unit
nameAttr pNames6[] = {
    { commonName_OID,             UTF8STRING, (ubyte*)"anexample.mocana.com", 20}};  // common name
nameAttr pNames7[] = {
    { pkcs9_emailAddress_OID,     UTF8STRING, (ubyte*)"anexample@mocana.com", 20}};  // pkcs-9-at-emailAddress

(and @since; accidentally omitted, forever...)

Field Documentation

◆ oid

const ubyte* nameAttr::oid

AttributeType: attribute's OID (object identifier). Use any of the following *_OID constants from src/asn1/oiddefs.h:

  • countryName_OID
  • stateOrProvinceName_OID
  • localityName_OID
  • organizationName_OID
  • organizationalUnitName_OID
  • commonName_OID
  • pkcs9_emailAddress_OID (verify which *_OID constants are valid)

◆ type

ubyte nameAttr::type

(Optional) DirectoryString CHOICE for the value field. Use any of the following constants from src/asn1/parseasn1.h:

  • TELETEXSTRING
  • PRINTABLESTRING
  • GENERALSTRING
  • UTF8STRING
  • BMPSTRING

◆ value

ubyte* nameAttr::value

(Optional) String containing information applicable to the oid field.

◆ valueLen

ubyte4 nameAttr::valueLen

Number of bytes in the name value buffer (value).


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