Using JSS 3.1Beta1 on NSS3.3, I can't figure this out, how do you start
with a PrivateKey and create a PrivateKeyInfo and then an
EncryptedPrivateKeyInfo?

I have tried PrivateKey.getEncoded() to get a byte[] so I can build the
required OCTET_STRING, but getEncoded says "not implemented".

So I tried the KeyWrapper.wrap, but it won't allow a PLAINTEXT
AlgorithmIdentifier (despite what the docs say) so I can't get a byte[]
without using a SymetricKey!

Blah!  I just want to make an EncryptedPrivateKeyInfo which has its own
encryption Algorithm for the key, right?  So how do you do it?  Is there
some fancy way of storing the key in the .db and then getting out an
EncryptedPrivateKeyInfo?  I don't see the sample code doing it, it
cheats and opens an already existing PKCS#12 file and then decryptes and
EncryptedPrivateKeyInfo from that.  How did you create it in the first
place?

Thanks for anything,
Jasen Halmes


Reply via email to