Top Description Fields Constructors Methods
org.bouncycastle.jcajce.spec

public Class OpenSSHPublicKeySpec

extends EncodedKeySpec
Class Inheritance
Imports
java.security.spec.EncodedKeySpec, org.bouncycastle.util.Arrays, .Strings

Holds an OpenSSH encoded public key.

Field Summary

Modifier and TypeField and Description
private static final String[]
private final String

Constructor Summary

AccessConstructor and Description
public
OpenSSHPublicKeySpec(byte[] encodedKey)

Construct and instance and determine the OpenSSH public key type.

Method Summary

Modifier and TypeMethod and Description
public String
getFormat()

Implements abstract java.security.spec.EncodedKeySpec.getFormat.

Returns the name of the encoding format associated with this key specification.

public String

Returns:

the type.
getType
()

The type of OpenSSH public key.

Inherited from java.security.spec.EncodedKeySpec:
getAlgorithmgetEncoded

Field Detail

allowedTypesback to summary
private static final String[] allowedTypes
typeback to summary
private final String type

Constructor Detail

OpenSSHPublicKeySpecback to summary
public OpenSSHPublicKeySpec(byte[] encodedKey)

Construct and instance and determine the OpenSSH public key type. The current types are ssh-rsa, ssh-ed25519, ssh-dss and ecdsa-*

It does not validate the key beyond identifying the type.

Method Detail

getFormatback to summary
public String getFormat()

Implements abstract java.security.spec.EncodedKeySpec.getFormat.

Doc from java.security.spec.EncodedKeySpec.getFormat.

Returns the name of the encoding format associated with this key specification.

If the opaque representation of a key (see Key) can be transformed (see KeyFactory) into this key specification (or a subclass of it), getFormat called on the opaque key returns the same value as the getFormat method of this key specification.

Returns:String

a string representation of the encoding format.

getTypeback to summary
public String getType()

The type of OpenSSH public key.

Returns:String

the type.