Package net.oauth.signature.pem
Class PKCS1EncodedKeySpec
- java.lang.Object
-
- net.oauth.signature.pem.PKCS1EncodedKeySpec
-
public class PKCS1EncodedKeySpec extends Object
PKCS#1 encoded private key is commonly used with OpenSSL. It provides CRT parameters so the private key operation can be much faster than using exponent/modulus alone, which is the case for PKCS#8 encoded key. Unfortunately, JCE doesn't have an API to decode the DER. This class takes DER buffer and decoded into CRT key.- Author:
- zhang
-
-
Constructor Summary
Constructors Constructor Description PKCS1EncodedKeySpec(byte[] keyBytes)
Construct a new PKCS#1 keyspec from DER encoded buffer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RSAPrivateCrtKeySpec
getKeySpec()
Get the key spec that JCE understands.
-
-
-
Constructor Detail
-
PKCS1EncodedKeySpec
public PKCS1EncodedKeySpec(byte[] keyBytes) throws IOException
Construct a new PKCS#1 keyspec from DER encoded buffer- Parameters:
keyBytes
- DER encoded octet stream- Throws:
IOException
-
-
Method Detail
-
getKeySpec
public RSAPrivateCrtKeySpec getKeySpec()
Get the key spec that JCE understands.- Returns:
- CRT keyspec defined by JCE
-
-