public class CAST128MacParameterSpec extends java.lang.Object implements java.security.spec.AlgorithmParameterSpec, ASN1Type
It specifies the length of the MAC, and the length of the key (both in bits).
CAST128MacParameter ::= SEQUENCE {
macLength INTEGER, -- MAC length, in bits
keyLength INTEGER, -- Key length, in bits
}
| Constructor and Description |
|---|
CAST128MacParameterSpec()
The default constructor.
|
CAST128MacParameterSpec(ASN1Object obj)
Creates a new
CAST128MacParameterSpec object from an
ASN1Object. |
CAST128MacParameterSpec(int macLength,
int keyLength)
Creates a new
CAST128MacParameterSpec object with the
specified components. |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ASN1Object obj)
Decodes a
CAST128MacParameterSpec object from an
ASN1Object. |
int |
getKeyLength()
Returns the length (size) of the key.
|
int |
getMacLength()
Returns the length (size) of the MAC.
|
void |
setKeyLength(int keyLength)
Sets the length (size) of the key.
|
void |
setMacLength(int macLength)
Sets the length (size) of the MAC.
|
ASN1Object |
toASN1Object()
Encodes this
CAST128MacParameterSpec object as an
ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
CAST128MacParameterSpec object. |
public CAST128MacParameterSpec()
It creates a new CAST128MacParameterSpec object with a default
MAC length of 64 and a default key length of 128.
public CAST128MacParameterSpec(int macLength,
int keyLength)
CAST128MacParameterSpec object with the
specified components.
macLength - the MAC length in bitskeyLength - the key length in bitspublic CAST128MacParameterSpec(ASN1Object obj) throws CodingException
CAST128MacParameterSpec object from an
ASN1Object.
The ASN1Object must be a CAST128MacParameter structure.
obj - the ASN.1 representation of a CAST128MacParameter structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic int getMacLength()
public int getKeyLength()
public void setMacLength(int macLength)
macLength - the MAC length in bitspublic void setKeyLength(int keyLength)
keyLength - the key length in bitspublic void decode(ASN1Object obj) throws CodingException
CAST128MacParameterSpec object from an
ASN1Object.
The ASN1Object must be a CAST128MacParameter structure.
decode in interface ASN1Typeobj - an ASN.1 representation of a CAST128MacParameter structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ASN1Object toASN1Object()
CAST128MacParameterSpec object as an
ASN1Object.
toASN1Object in interface ASN1Typepublic java.lang.String toString()
CAST128MacParameterSpec object.
toString in class java.lang.Object