From DEROctetString to KeyUsage
17:49 27 Jun 2010

In bouncycastle I can create a DEROctetString starting from a KeyUsage.

How can I obtain KeyUsage starting from a DEROctetString then?

Example:

DEROctetString derString = new DEROctetString(new KeyUsage(KeyUsage.digitalSignature));
KeyUsage ku = ...(some code to get back KeyUsage starting from derString)...

I need this because I'm able to create Certificate Requests with KeyUsage extension request, but then, given the Certificate Request alone, I'm not able to get back the KeyUsage extension.

java security certificate bouncycastle pki