Package org.cryptacular.ssh
Class SSHPublicKeyDecoder
java.lang.Object
org.cryptacular.ssh.SSHPublicKeyDecoder
Decodes public keys formatted as described in RFC 4253, Section 6.6, Public Key Algorithms.
RSA and DSS key formats are supported.
- Author:
- Middleware Services
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.crypto.params.AsymmetricKeyParameterdecode(byte[] encoded) Produces an asymmetric key parameter from an encoded representation.org.bouncycastle.crypto.params.AsymmetricKeyParameterProduces an asymmetric key parameter from an encoded representation.static booleanisRFC4253EncodedPublicKey(byte[] key) Attempts to infer whether the encoded bytes contain an SSH public key.static booleanAttempts to infer whether the encoded bytes contain an SSH public key.
-
Constructor Details
-
SSHPublicKeyDecoder
public SSHPublicKeyDecoder()
-
-
Method Details
-
isRFC4253EncodedPublicKey
Attempts to infer whether the encoded bytes contain an SSH public key.- Parameters:
key- encoded key as a string- Returns:
- true if encoding format is probable, false otherwise
-
isRFC4253EncodedPublicKey
public static boolean isRFC4253EncodedPublicKey(byte[] key) Attempts to infer whether the encoded bytes contain an SSH public key.- Parameters:
key- encoded key as a byte array- Returns:
- true if encoding format is probable, false otherwise
-
decode
public org.bouncycastle.crypto.params.AsymmetricKeyParameter decode(byte[] encoded) Produces an asymmetric key parameter from an encoded representation.- Parameters:
encoded- encoded data- Returns:
- Decoded object.
-
decode
Produces an asymmetric key parameter from an encoded representation.- Parameters:
pubData- encoded data- Returns:
- Decoded object.
- Throws:
EncodingException- on encoding errors.
-