[kmf-discuss] OIDs and Extensions
Wyllys Ingersoll
wyllys.ingersoll at sun.com
Tue May 22 11:55:29 PDT 2007
Massimiliano Pala wrote:
> Hi Wyllys!
>
> Thank you again :) Just last question... is there a KMF_OID_[..] type for
> the tags, or shall I build my own function/ .h file ? In this case, where
> do I find the corresponding values (to set as tagAndValue->tag )?
>
> Thank you again!
>
There are quite a few pre-defined OID defined as constants
in the kmftypes.h header file that you can use. Look for
"KMFOID_CommonName", for example.
-Wyllys
> Later,
> Dr. Max
>
>
> Wyllys Ingersoll wrote:
>> Oops, I forgot a piece. See below...
>>
>> Wyllys Ingersoll wrote:
>>> Try this:
>>>
>>> ...
>>> KMF_X509_EXTENSION newextn;
>>> char openca_extn = {0x01, 0x02, 0x03, 0x04, 0xAA, 0xF8 };
>>> KMF_OID oid; /* initialize oid with your custom OID value */
>>
>> char *value = "TEST VALUE";
>>
>>> (void) memset(&newextn, 0, sizeof (newextn));
>>>
>>> newextn.critical = 1;
>>> newextn.extnId = oid;
>>> newextn.format = KMF_X509_DATAFORMAT_ENCODED;
>>> newextn.BERvalue.Data = openca_extn;
>>> newextn.BERvalue.Length = sizeof (openca_extn);
>>>
>>
>> newextn.value.tagAndValue = malloc(sizeof (KMF_X509EXT_TAGandVALUE));
>> newextn.value.tagAndValue->tag = 12; /* UTF8_STRING tag*/
>> newextn.value.tagAndValue->value.Data = value;
>> newextn.value.tagAndValue->value.Length = strlen(value);
>>
>>> rv = KMF_SetCertExtension(Cert, &newextn);
>>> ...
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> kmf-discuss mailing list
> kmf-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/kmf-discuss
More information about the kmf-discuss
mailing list