shankar srinivasan wrote:
> Hi,
>
> I need to get a certificate from the database, sign the using
> private key and encrypt using public key and similarly perform the
> decryption and verification. Could anyone tell me which library I can use
> for performing this and also if any example source is available.
CERT_ functions let to search for certificate.
SECKEY_FindKeyFromCert() will get you private key associated with that cert.
CERT_ExtractPublicKey() will get the public key from the cert.
Sign/Verify interface is SECSGN_*
The next question, though is what is it you want to encrypt? A block of
data, RAW RSA data, PKCS #1 formated data, a key?
Samples for using these can be found in mozilla/security/nss/cmd
documentation for NSS can be found on the mozilla home page.
I would particularly look at the smime samples.
bob
>
>
>
> Thanks,
>
> shankar