Package org.cryptacular.spec
Class CodecSpec
java.lang.Object
org.cryptacular.spec.CodecSpec
Describes a string-to-byte encoding provides a means to create a new instance of the coed via the
newInstance()
method.- Author:
- Middleware Services
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CodecSpec
Base32 encoding specification.static final CodecSpec
Unpadded base32 encoding specification.static final CodecSpec
Base64 encoding specification.static final CodecSpec
Unpadded base64 encoding specification.static final CodecSpec
URL-safe base64 encoding specification.static final CodecSpec
Hexadecimal encoding specification.static final CodecSpec
Lowercase hexadecimal encoding specification.static final CodecSpec
Uppercase hexadecimal encoding specification. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance of the cryptographic primitive described by this specification.toString()
-
Field Details
-
HEX
Hexadecimal encoding specification. -
HEX_LOWER
Lowercase hexadecimal encoding specification. -
HEX_UPPER
Uppercase hexadecimal encoding specification. -
BASE32
Base32 encoding specification. -
BASE32_UNPADDED
Unpadded base32 encoding specification. -
BASE64
Base64 encoding specification. -
BASE64_URLSAFE
URL-safe base64 encoding specification. -
BASE64_UNPADDED
Unpadded base64 encoding specification.
-
-
Constructor Details
-
CodecSpec
Creates a new instance of the given encoding.- Parameters:
encoding
- Name of encoding.
-
-
Method Details
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceSpec<Codec>
- Returns:
- The name of the encoding, e.g. "Hex", "Base32", "Base64".
-
newInstance
Description copied from interface:Spec
Creates a new instance of the cryptographic primitive described by this specification.- Specified by:
newInstance
in interfaceSpec<Codec>
- Returns:
- New instance of cryptographic primitive.
-
toString
-