Class RSAPrivateKeyPKCS8
java.lang.Object
com.github.toolarium.security.pki.impl.rsa.RSAPrivateKeyPKCS8
- All Implemented Interfaces:
Serializable,RSAKey,RSAPrivateKey,Key,PrivateKey,Destroyable
This class implements the encoding of a RSA private key
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRSAPrivateKeyPKCS8(byte[] encoded) Default constructor for RSAPrivateKeyPKCS8RSAPrivateKeyPKCS8(RSAPrivateCrtKeySpec keyspec) Copy constructor for RSAPrivateKeyPKCS8 -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck the encodingbyte[]Gets the key specificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Constructor Details
-
RSAPrivateKeyPKCS8
public RSAPrivateKeyPKCS8(byte[] encoded) Default constructor for RSAPrivateKeyPKCS8- Parameters:
encoded- the private key as byte array
-
RSAPrivateKeyPKCS8
Copy constructor for RSAPrivateKeyPKCS8- Parameters:
keyspec- the class
-
-
Method Details
-
getAlgorithm
- Specified by:
getAlgorithmin interfaceKey- See Also:
-
getFormat
-
checkEncoding
Check the encoding- Throws:
InvalidKeySpecException- in case of error
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncodedin interfaceKey- See Also:
-
getKeySpec
Gets the key specification- Returns:
- the key spec
-
getPrivateExponent
- Specified by:
getPrivateExponentin interfaceRSAPrivateKey- See Also:
-
getModulus
- Specified by:
getModulusin interfaceRSAKey- See Also:
-