PUB
- Type of PublicKey
PRV
- Type of PrivateKey
public interface PublicKeyEntryDecoder<PUB extends PublicKey,PRV extends PrivateKey> extends KeyEntryResolver<PUB,PRV>, PublicKeyEntryResolver
OpenSSH
encoded key dataMAX_BIGINT_OCTETS_COUNT
FAILING, IGNORING
Modifier and Type | Method and Description |
---|---|
default PUB |
decodePublicKey(SessionContext session,
String keyType,
byte... keyData) |
default PUB |
decodePublicKey(SessionContext session,
String keyType,
byte[] keyData,
int offset,
int length) |
PUB |
decodePublicKey(SessionContext session,
String keyType,
InputStream keyData) |
default PUB |
decodePublicKeyByType(SessionContext session,
String keyType,
InputStream keyData) |
String |
encodePublicKey(OutputStream s,
PUB key)
|
default PublicKey |
resolve(SessionContext session,
String keyType,
byte[] keyData) |
cloneKeyPair, clonePrivateKey, clonePublicKey, decodeBigInt, decodeInt, decodeString, decodeString, decodeString, encodeBigInt, encodeInt, encodeString, encodeString, encodeString, generateKeyPair, getKeyFactoryInstance, getKeyPairGenerator, readRLEBytes, writeRLEBytes, writeRLEBytes
getPrivateKeyType, getPublicKeyType
findSupporterByKeyTypeName, getSupportedKeyTypes
default PublicKey resolve(SessionContext session, String keyType, byte[] keyData) throws IOException, GeneralSecurityException
resolve
in interface PublicKeyEntryResolver
session
- The SessionContext
for invoking this load command - may
be null
if not invoked within a session context (e.g., offline tool or session unknown).keyType
- The OpenSSH
reported key typekeyData
- The OpenSSH
encoded key dataPublicKey
- ignored if null
IOException
- If failed to parse the key dataGeneralSecurityException
- If failed to generate the keydefault PUB decodePublicKey(SessionContext session, String keyType, byte... keyData) throws IOException, GeneralSecurityException
session
- The SessionContext
for invoking this command - may
be null
if not invoked within a session context (e.g., offline tool or session unknown).keyType
- The OpenSSH
reported key typekeyData
- The key data bytes in OpenSSH
format (after BASE64
decoding) - ignored if null
/emptyPublicKey
- or null
if no dataIOException
- If failed to decode the keyGeneralSecurityException
- If failed to generate the keydefault PUB decodePublicKey(SessionContext session, String keyType, byte[] keyData, int offset, int length) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
default PUB decodePublicKeyByType(SessionContext session, String keyType, InputStream keyData) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
PUB decodePublicKey(SessionContext session, String keyType, InputStream keyData) throws IOException, GeneralSecurityException
session
- The SessionContext
for invoking this command - may
be null
if not invoked within a session context (e.g., offline tool or session unknown).keyType
- The reported / encode key typekeyData
- The key data bytes stream positioned after the key type decoding
and making sure it is one of the supported typesPublicKey
IOException
- If failed to read from the data streamGeneralSecurityException
- If failed to generate the keyString encodePublicKey(OutputStream s, PUB key) throws IOException
s
- The OutputStream
to write the data tokey
- The PublicKey
- may not be null
KeyTypeNamesSupport.getSupportedKeyTypes()
IOException
- If failed to generate the encodingCopyright © 2008–2022 The Apache Software Foundation. All rights reserved.