[kmf-discuss] OIDs and Extensions
Massimiliano Pala
pala at cs.dartmouth.edu
Tue May 22 11:37:52 PDT 2007
Hi,
thanks Wyllys. And what about adding types that are already known,
e.g. 'UTF8String' or 'IP' ? Since I can not use the ASN1 lib, are
there functions I can use to encode those and then use the example
you sent me ?
Another very quick question. How do I encode a multi-valued extension ?
If I am not wrong, the KMF_SetCertExtension() preserves the old value
of the extension, thus, just calling it several times for the same
oid will add the values to the same extension... is that correct ?
Cheers,
Dr. Max
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 */
>
> (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);
>
> rv = KMF_SetCertExtension(Cert, &newextn);
> ...
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3088 bytes
Desc: S/MIME Cryptographic Signature
Url : http://oss-beta1.opensolaris.org/pipermail/kmf-discuss/attachments/20070522/fe2f2666/attachment.bin
More information about the kmf-discuss
mailing list