David Stutzman wrote:

> Here's some certutil -L output for the cert I am playing with here:
>          Signed Extensions:
>              Name: Certificate Key Usage
>              Critical: True
>              Usages: Digital Signature
>                      Non-Repudiation
> 
>              Name: Certificate Type
>              Critical: True
>              Data: <SSL Client,SSL Server>

That says the cert is valid for SSL, but not S/MIME or object signing.

It sounds like you're inventing a new network appliation/protocol for
this, so perhaps none of those categories directly applies to you.
It's up to your application to ask for the usage that is relevant it it.

> I tested the certificate with the usages above passing in both 
> certificateUsageEmailSigner and certificateUsageObjectSigner to 
> CERT_VerifyCertificate and got a -8101 (SEC_ERROR_INADEQUATE_CERT_TYPE) 
> both times.

That's exactly as predicted, given the Certificate Type extension above.

> Is it ok to ignore cert usage and just look at the raw key usages myself 
> and require that digital signature and non-repudiation be present or am 
> I just beating the dead horse with the stick here and really should be 
> using either an email signing cert or an object signing cert?  

You're not likely to get CAs to issue a cert for a new type of usage that
you propose.  So IMO your best bet is to decide which of the above usages
most closely matches what you're doing, and then ask CERT_VerifyCert* to
verify for that usage.  For your personal testing and development purposes,
you could easily just test for SSL client usage, since that's what you have.

Personally, I'd say that what you're doing sounds more like email usage
than SSL, because you're generating durable signatures, which email does
and SSL does not.  But for your immediate test purposes, SSL certs should
be adequate.

> Again, I 
> just need to sign an arbitrary blob of input data that is passed in and 
> pass it back to the caller and it's not being used for email.

Think of these usages more abstractly.  Email usage generates signatures
that are attached to the data, and that (may) last as long as the data to
which they are attached.  SSL generates signatures that are used at the
beginning of an SSL connection and are then immediately discarded.  The
data that passes through the authenticated channel is not itself signed,
and when the channel is over and done, there remains no durable signature.

Which of those applications sounds more like yours?
Figure that out, and then Pick a cert of that type.

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

Reply via email to