Stephen Hamilton wrote, On 2008-02-23 10:40:
> Hi,
> I'm new to the list, and I've been working with NSS on a project that 
> requires smartcard/CAC interaction.  I've pretty much gotten it to work 
> the way I want, but I stumbled on something that doesn't make much sense.
> 
> I tried to use the Cert_DecodeDERCertificate() function, and although it 
> exists in cert.h, it wasn't found in the library during linking.  After 
> doing a grep & strings on libnss, I found it to be 
> __Cert_DecodeDERCertificate.  I replaced this in my code, and it works 
> now.  Is this the right way to do it, or did I do something backwards?

Several comments.

1. Functions whose names start with double underscore are considered to be
private to NSS, for use by other NSS shared libraries, not for use by
applications.

2. There is one exception to that rule.  We've decided that
CERT_NewTempCertificate is really not private, even though it persists
in having a double-underscore prefix.  You should probably be using
CERT_NewTempCertificate rather than Cert_DecodeDERCertificate.

3. Applications and libraries that are part of NSS itself use a trick
to get past the double underscores.  They #include the private NSS
header file nssrenam.h.  You'll understand why when you look at it.

I don't recommend that you #include that file, but you can borrow the
technique it uses for CERT_NewTempCertificate.

Hope this helps.

/Nelson
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to