Package com.trilead.ssh2.signature
Class OpenSshCertificateDecoder
- java.lang.Object
-
- com.trilead.ssh2.crypto.CertificateDecoder
-
- com.trilead.ssh2.signature.OpenSshCertificateDecoder
-
- Direct Known Subclasses:
ECDSAKeyAlgorithm.OpenSshEcdsaCertificateDecoder
abstract class OpenSshCertificateDecoder extends CertificateDecoder
An decoder that can read keys written in the 'new' OpenSSH format, generally identified with the header 'BEGIN OPENSSH PRIVATE KEY'.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classOpenSshCertificateDecoder.SshCipher
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringkeyAlgorithm
-
Constructor Summary
Constructors Constructor Description OpenSshCertificateDecoder(java.lang.String keyAlgorithm)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.security.KeyPaircreateKeyPair(PEMStructure pemStructure)java.security.KeyPaircreateKeyPair(PEMStructure pemStructure, java.lang.String password)private static byte[]decryptData(byte[] encryptedData, byte[] keyAndIv, OpenSshCertificateDecoder.SshCipher sshCipher)private static byte[]generateKayAndIvPbkdf2(byte[] password, byte[] salt, int rounds, int keyLength, int ivLength)(package private) abstract java.security.KeyPairgenerateKeyPair(TypesReader typesReader)java.lang.StringgetEndLine()java.lang.StringgetStartLine()
-
-
-
Method Detail
-
getStartLine
public java.lang.String getStartLine()
- Specified by:
getStartLinein classCertificateDecoder
-
getEndLine
public java.lang.String getEndLine()
- Specified by:
getEndLinein classCertificateDecoder
-
createKeyPair
public java.security.KeyPair createKeyPair(PEMStructure pemStructure)
- Specified by:
createKeyPairin classCertificateDecoder
-
createKeyPair
public java.security.KeyPair createKeyPair(PEMStructure pemStructure, java.lang.String password) throws java.io.IOException
- Overrides:
createKeyPairin classCertificateDecoder- Throws:
java.io.IOException
-
generateKeyPair
abstract java.security.KeyPair generateKeyPair(TypesReader typesReader) throws java.security.GeneralSecurityException, java.io.IOException
- Throws:
java.security.GeneralSecurityExceptionjava.io.IOException
-
decryptData
private static byte[] decryptData(byte[] encryptedData, byte[] keyAndIv, OpenSshCertificateDecoder.SshCipher sshCipher)
-
generateKayAndIvPbkdf2
private static byte[] generateKayAndIvPbkdf2(byte[] password, byte[] salt, int rounds, int keyLength, int ivLength)
-
-