Package org.wildfly.security.util
Class AbstractAlgorithmParametersSpiImpl<P extends AlgorithmParameterSpec>
java.lang.Object
java.security.AlgorithmParametersSpi
org.wildfly.security.util.AbstractAlgorithmParametersSpiImpl<P>
- Type Parameters:
P- the parameter type represented by the subclass
- Direct Known Subclasses:
DigestPasswordAlgorithmParametersSpiImpl,IteratedPasswordAlgorithmParametersSpiImpl,IteratedSaltedPasswordAlgorithmParametersSpiImpl,MaskedPasswordAlgorithmParametersSpiImpl,OneTimePasswordAlgorithmParametersSpiImpl,RSAParameterSpiImpl,SaltedPasswordAlgorithmParametersSpiImpl
public abstract class AbstractAlgorithmParametersSpiImpl<P extends AlgorithmParameterSpec>
extends AlgorithmParametersSpi
A base class for classes which implement
AlgorithmParametersSpi that encode parameters using ASN.1.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract PengineDecode(ASN1Decoder decoder) Decode a parameter instance.protected abstract voidengineEncode(ASN1Encoder encoder, P parameters) Encode a parameter instance.protected final byte[]Implementation of theengineGetEncodedmethod.protected final byte[]engineGetEncoded(String format) Implementation of theengineGetEncodedmethod.protected final <T extends AlgorithmParameterSpec>
TengineGetParameterSpec(Class<T> type) Implementation of theengineGetParameterSpecmethod.protected final voidengineInit(byte[] params) Implementation of theengineInitmethod.protected final voidengineInit(byte[] params, String format) Implementation of theengineInitmethod.protected final voidengineInit(AlgorithmParameterSpec paramSpec) Implementation of theengineInitmethod.protected StringImplementation of theengineToStringmethod.Get the type of parameters for this class.
-
Constructor Details
-
AbstractAlgorithmParametersSpiImpl
protected AbstractAlgorithmParametersSpiImpl()Construct a new instance.
-
-
Method Details
-
getParameterType
Get the type of parameters for this class.- Returns:
- the type of parameters for this class (must not be
null)
-
engineInit
protected final void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException Implementation of theengineInitmethod.- Specified by:
engineInitin classAlgorithmParametersSpi- Parameters:
paramSpec- the parameter specification- Throws:
InvalidParameterSpecException- if an argument is invalid or encoding failed
-
engineInit
Implementation of theengineInitmethod.- Specified by:
engineInitin classAlgorithmParametersSpi- Parameters:
params- the encoded parameter specification- Throws:
IOException- if decoding failed
-
engineInit
Implementation of theengineInitmethod.- Specified by:
engineInitin classAlgorithmParametersSpi- Parameters:
params- the encoded parameter specificationformat- the format (must beASN.1)- Throws:
IOException- if decoding failed or the format is not equal toASN.1
-
engineEncode
protected abstract void engineEncode(ASN1Encoder encoder, P parameters) throws ASN1Exception, InvalidParameterSpecException Encode a parameter instance.- Parameters:
encoder- the encoder to use (notnull)parameters- the parameter instance (notnull)- Throws:
ASN1Exception- if there is an encoding problem (usually thrown directly by theASN1Encoder)InvalidParameterSpecException- if some other encoding error occurred
-
engineDecode
Decode a parameter instance. Subclasses should ensure that all elements are consumed (including sequence terminators and so forth).- Parameters:
decoder- the decoder to use (notnull)- Returns:
- the parameter instance (must not be
null) - Throws:
ASN1Exception- if there is a decoding problem (usually thrown directly by theASN1Decoder)IOException- if some other decoding error occurred
-
engineGetParameterSpec
protected final <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> type) throws InvalidParameterSpecException Implementation of theengineGetParameterSpecmethod.- Specified by:
engineGetParameterSpecin classAlgorithmParametersSpi- Type Parameters:
T- the parameter specification type- Parameters:
type- the parameter specification type class (must not benull)- Returns:
- the parameter specification (must not be
null) - Throws:
InvalidParameterSpecException- if the type is not supported
-
engineGetEncoded
protected final byte[] engineGetEncoded()Implementation of theengineGetEncodedmethod.- Specified by:
engineGetEncodedin classAlgorithmParametersSpi- Returns:
- the encoded representation (not
null)
-
engineGetEncoded
Implementation of theengineGetEncodedmethod.- Specified by:
engineGetEncodedin classAlgorithmParametersSpi- Parameters:
format- the format string (must not benull)- Returns:
- the encoded representation (not
null) - Throws:
IOException- if the given format is notASN.1
-
engineToString
Implementation of theengineToStringmethod.- Specified by:
engineToStringin classAlgorithmParametersSpi- Returns:
- the string representation
-