Class ECDSAPrivateKeyInfoKeyPairConverter
java.lang.Object
net.schmizz.sshj.userauth.keyprovider.pkcs.ECDSAPrivateKeyInfoKeyPairConverter
- All Implemented Interfaces:
KeyPairConverter<org.bouncycastle.asn1.pkcs.PrivateKeyInfo>
class ECDSAPrivateKeyInfoKeyPairConverter
extends Object
implements KeyPairConverter<org.bouncycastle.asn1.pkcs.PrivateKeyInfo>
Key Pair Converter from ECDSA Private Key Information to PEM Key Pair
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private static final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate byte[]
getEncodedPublicKey
(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo) Get Encoded Elliptic Curve Public Key calculated according to RFC 6979 Section 2.2org.bouncycastle.openssl.PEMKeyPair
getKeyPair
(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo) Get PEM Key Pair calculating ECDSA Public Key from ECDSA Private Key Informationprivate org.bouncycastle.asn1.x9.X9ECParameters
getParameters
(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier) private org.bouncycastle.math.ec.ECPoint
getPublicKey
(org.bouncycastle.asn1.x9.X9ECParameters parameters, BigInteger privateKey)
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
POINT_COMPRESSED
private static final boolean POINT_COMPRESSED- See Also:
-
-
Constructor Details
-
ECDSAPrivateKeyInfoKeyPairConverter
ECDSAPrivateKeyInfoKeyPairConverter()
-
-
Method Details
-
getKeyPair
public org.bouncycastle.openssl.PEMKeyPair getKeyPair(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo) throws IOException Get PEM Key Pair calculating ECDSA Public Key from ECDSA Private Key Information- Specified by:
getKeyPair
in interfaceKeyPairConverter<org.bouncycastle.asn1.pkcs.PrivateKeyInfo>
- Parameters:
privateKeyInfo
- ECDSA Private Key Information- Returns:
- PEM Key Pair
- Throws:
IOException
- Thrown on Public Key parsing failures
-
getEncodedPublicKey
private byte[] getEncodedPublicKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo) throws IOException Get Encoded Elliptic Curve Public Key calculated according to RFC 6979 Section 2.2- Parameters:
privateKeyInfo
- ECDSA Private Key Information- Returns:
- Encoded Elliptic Curve Public Key
- Throws:
IOException
- Thrown on failures parsing private key
-
getParameters
private org.bouncycastle.asn1.x9.X9ECParameters getParameters(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier) -
getPublicKey
private org.bouncycastle.math.ec.ECPoint getPublicKey(org.bouncycastle.asn1.x9.X9ECParameters parameters, BigInteger privateKey)
-