public class PrivateKeyParser extends Object
| Constructor and Description |
|---|
PrivateKeyParser() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getPKCS8EncodedKeyAlgorithm(byte[] encodedKey)
Gets the algorithm used by a PKCS#8 encoded private key.
|
static RSAPrivateCrtKeySpec |
getRSAKeySpec(byte[] keyBytes)
Convert PKCS#1 encoded private key into RSAPrivateCrtKeySpec.
|
public static String getPKCS8EncodedKeyAlgorithm(byte[] encodedKey)
encodedKey - The encoded private key.VertxException - if the key is not PKCS#8 encoded or uses an unsupported
algorithm.public static RSAPrivateCrtKeySpec getRSAKeySpec(byte[] keyBytes) throws VertxException
--
-- Representation of RSA private key with information for the CRT algorithm.
--
RSAPrivateKey ::= SEQUENCE {
version Version,
modulus INTEGER, -- n
publicExponent INTEGER, -- e
privateExponent INTEGER, -- d
prime1 INTEGER, -- p
prime2 INTEGER, -- q
exponent1 INTEGER, -- d mod (p-1)
exponent2 INTEGER, -- d mod (q-1)
coefficient INTEGER, -- (inverse of q) mod p
otherPrimeInfos OtherPrimeInfos OPTIONAL
}
keyBytes - PKCS#1 encoded keyVertxExceptionCopyright © 2020. All rights reserved.