public class MacParameterSpec extends java.lang.Object implements java.security.spec.AlgorithmParameterSpec, ASN1Type
It specifies only the MAC length (in bits).
MacParameter ::= INTEGER -- Length of MAC (16, 24, 32, 40, 48 or 64 bits)
Although the comment in the structure indicates a specific range for the length, this is not enforced here. Instead, this must be enforced by the MAC algorithms themselves.
| Constructor and Description |
|---|
MacParameterSpec()
The default constructor.
|
MacParameterSpec(ASN1Object obj)
Creates a new
MacParameterSpec object from an
ASN1Object. |
MacParameterSpec(int length)
Creates a new
MacParameterSpec object with the specified
component. |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ASN1Object obj)
Decodes a
MacParameterSpec object from an
ASN1Object. |
int |
getLength()
Returns the length (size) of the MAC.
|
void |
setLength(int length)
Sets the length (size) of the MAC.
|
ASN1Object |
toASN1Object()
Encodes this
MacParameterSpec object as an
ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
MacParameterSpec object. |
public MacParameterSpec()
It creates a new MacParameterSpec object with a default MAC
length of 64.
public MacParameterSpec(int length)
MacParameterSpec object with the specified
component.length - the MAC length in bitspublic MacParameterSpec(ASN1Object obj) throws CodingException
MacParameterSpec object from an
ASN1Object.
The ASN1Object must be an MacParameter structure.
obj - the ASN.1 representation of an MacParameter structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic int getLength()
public void setLength(int length)
length - the MAC length in bitspublic void decode(ASN1Object obj) throws CodingException
MacParameterSpec object from an
ASN1Object.
The ASN1Object must be a MacParameter structure.
decode in interface ASN1Typeobj - an ASN.1 representation of a MacParameter structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ASN1Object toASN1Object()
MacParameterSpec object as an
ASN1Object.toASN1Object in interface ASN1Typepublic java.lang.String toString()
MacParameterSpec object.toString in class java.lang.Object