PUB
- Type of PublicKey
PRV
- Type of PrivateKey
public interface PublicKeyEntryDecoder<PUB extends java.security.PublicKey,PRV extends java.security.PrivateKey> extends KeyEntryResolver<PUB,PRV>, PublicKeyEntryResolver
OpenSSH
encoded key dataFAILING, IGNORING
Modifier and Type | Method and Description |
---|---|
default PUB |
decodePublicKey(byte... keyData) |
default PUB |
decodePublicKey(byte[] keyData,
int offset,
int length) |
default PUB |
decodePublicKey(java.io.InputStream keyData) |
PUB |
decodePublicKey(java.lang.String keyType,
java.io.InputStream keyData) |
java.lang.String |
encodePublicKey(java.io.OutputStream s,
PUB key)
Encodes the
PublicKey using the OpenSSH format - same
one used by the decodePublicKey method(s) |
default java.security.PublicKey |
resolve(java.lang.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, getSupportedTypeNames
default java.security.PublicKey resolve(java.lang.String keyType, byte[] keyData) throws java.io.IOException, java.security.GeneralSecurityException
resolve
in interface PublicKeyEntryResolver
keyType
- The OpenSSH
reported key typekeyData
- The OpenSSH
encoded key dataPublicKey
- ignored if null
java.io.IOException
- If failed to parse the key datajava.security.GeneralSecurityException
- If failed to generate the keydefault PUB decodePublicKey(byte... keyData) throws java.io.IOException, java.security.GeneralSecurityException
keyData
- The key data bytes in OpenSSH
format (after
BASE64 decoding) - ignored if null
/emptyPublicKey
- or null
if no datajava.io.IOException
- If failed to decode the keyjava.security.GeneralSecurityException
- If failed to generate the keydefault PUB decodePublicKey(byte[] keyData, int offset, int length) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
default PUB decodePublicKey(java.io.InputStream keyData) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
PUB decodePublicKey(java.lang.String keyType, java.io.InputStream keyData) throws java.io.IOException, java.security.GeneralSecurityException
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
java.io.IOException
- If failed to read from the data streamjava.security.GeneralSecurityException
- If failed to generate the keyjava.lang.String encodePublicKey(java.io.OutputStream s, PUB key) throws java.io.IOException
PublicKey
using the OpenSSH
format - same
one used by the decodePublicKey
method(s)s
- The OutputStream
to write the data tokey
- The PublicKey
- may not be null
IdentityResourceLoader.getSupportedTypeNames()
java.io.IOException
- If failed to generate the encoding