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 class
OpenSshCertificateDecoder.SshCipher
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
keyAlgorithm
-
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.KeyPair
createKeyPair(PEMStructure pemStructure)
java.security.KeyPair
createKeyPair(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.KeyPair
generateKeyPair(TypesReader typesReader)
java.lang.String
getEndLine()
java.lang.String
getStartLine()
-
-
-
Method Detail
-
getStartLine
public java.lang.String getStartLine()
- Specified by:
getStartLine
in classCertificateDecoder
-
getEndLine
public java.lang.String getEndLine()
- Specified by:
getEndLine
in classCertificateDecoder
-
createKeyPair
public java.security.KeyPair createKeyPair(PEMStructure pemStructure)
- Specified by:
createKeyPair
in classCertificateDecoder
-
createKeyPair
public java.security.KeyPair createKeyPair(PEMStructure pemStructure, java.lang.String password) throws java.io.IOException
- Overrides:
createKeyPair
in classCertificateDecoder
- Throws:
java.io.IOException
-
generateKeyPair
abstract java.security.KeyPair generateKeyPair(TypesReader typesReader) throws java.security.GeneralSecurityException, java.io.IOException
- Throws:
java.security.GeneralSecurityException
java.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)
-
-