Hello,
I'm trying to coerce NDES to issue a certificate and I've been able to do this given some of the sample code that's on the site however I'm also trying to set a SAN on the certificate request and I'm struggling. I'm using JScep 2.0 and as a result BouncyCastle 1.47.
I also don't have a lot of experience using any crypto api(s) and I was hoping somebody can point me in the right direction. I've pasted a snippet of code with my attempt to set the SAN on the CSR.
Here it is:
String dn = "DC=local, DC=dvam, CN=Users, CN=User Development";
PKCS10CertificationRequestBuilder crb = new JcaPKCS10CertificationRequestBuilder( new X500Name( dn ), keyPair.getPublic() );
crb.addAttribute(org.bouncycastle.asn1.x509.X509Extension.subjectAlternativeName,
new org.bouncycastle.asn1.DEROctetString( "email=dev...@dvam.local".getBytes() ) );
This runs however the certificate that I receive back has no SAN set. I've attempted to perform these operation a number of different other ways such as creating a vector of OIDs and values however I get the same result. No SAN set.
The NDES log shows this:
2902.419.0:<2012/10/25, 14:21:52>: 0x80070057 (WIN32: 87)
2905.4156.0:<2012/10/25, 14:21:52>: 0x80070057 (WIN32: 87)
2905.3497.0:<2012/10/25, 14:21:52>: 0x80070057 (WIN32: 87)
The error message associated with the "WIN32: 87" code is "Invalid Parameter" and my though is that this is not an error but a warning and not from NDES but from the CA.
There is some configuration that's required like installing the NDES hotfix and enabling SAN, through certutil, on the CA however none of that has worked. Any help would be greatly appreciated.
One last thing that I want to mention which is when I do run my code I get this warning:
"4270 [main] WARN org.jscep.message.PkiMessageDecoder - Unable to verify message because the signedData contained no certificates."
I'm not sure if that means anything in this context but I thought that I'd add that information regardless.
I also have no problem posting the code since I'm just prototyping the idea of using SCEP.
Thanks,
- Danny