PUB
- Type of PublicKey
PRV
- Type of PrivateKey
public interface KeyEntryResolver<PUB extends PublicKey,PRV extends PrivateKey> extends IdentityResourceLoader<PUB,PRV>
MAX_BIGINT_OCTETS_COUNT
getPrivateKeyType, getPublicKeyType
findSupporterByKeyTypeName, getSupportedKeyTypes
default KeyPair generateKeyPair(int keySize) throws GeneralSecurityException
keySize
- Key size in bitsKeyPair
with the specified key sizeGeneralSecurityException
- if unable to generate the pairdefault KeyPair cloneKeyPair(KeyPair kp) throws GeneralSecurityException
kp
- The KeyPair
to be cloned - ignored if null
null
if no original pair)GeneralSecurityException
- If failed to clone - e.g., provided key
pair does not contain keys of the expected typeIdentityResourceLoader.getPublicKeyType()
,
IdentityResourceLoader.getPrivateKeyType()
PUB clonePublicKey(PUB key) throws GeneralSecurityException
key
- The PublicKey
to clone - ignored if null
null
if no original key)GeneralSecurityException
- If failed to clone the keyPRV clonePrivateKey(PRV key) throws GeneralSecurityException
key
- The PrivateKey
to clone - ignored if null
null
if no original key)GeneralSecurityException
- If failed to clone the keyKeyPairGenerator getKeyPairGenerator() throws GeneralSecurityException
KeyPairGenerator
suitable for this decoderGeneralSecurityException
- If failed to create the generatorKeyFactory getKeyFactoryInstance() throws GeneralSecurityException
KeyFactory
suitable for the specific decoder typeGeneralSecurityException
- If failed to create onestatic int encodeString(OutputStream s, String v) throws IOException
IOException
static int encodeString(OutputStream s, String v, String charset) throws IOException
IOException
static int encodeString(OutputStream s, String v, Charset cs) throws IOException
IOException
static int encodeBigInt(OutputStream s, BigInteger v) throws IOException
IOException
static int writeRLEBytes(OutputStream s, byte... bytes) throws IOException
IOException
static int writeRLEBytes(OutputStream s, byte[] bytes, int off, int len) throws IOException
IOException
static byte[] encodeInt(OutputStream s, int v) throws IOException
IOException
static String decodeString(InputStream s, int maxChars) throws IOException
IOException
static String decodeString(InputStream s, String charset, int maxChars) throws IOException
IOException
static String decodeString(InputStream s, Charset cs, int maxChars) throws IOException
IOException
static BigInteger decodeBigInt(InputStream s) throws IOException
IOException
static byte[] readRLEBytes(InputStream s, int maxAllowed) throws IOException
IOException
static int decodeInt(InputStream s) throws IOException
IOException
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.