Top Description Inners Fields Constructors Methods
org.bouncycastle.jcajce.spec

public Class SkeinParameterSpec

extends Object
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStreamWriter, java.security.spec.AlgorithmParameterSpec, java.text.DateFormat, .SimpleDateFormat, java.util.Collections, .Date, .HashMap, .Iterator, .Locale, .Map, org.bouncycastle.util.Arrays, .Integers

Parameters for the Skein hash function - a series of byte[] strings identified by integer tags.

Parameterised Skein can be used for:

See Also
org.bouncycastle.crypto.digests.SkeinEngine, org.bouncycastle.crypto.digests.SkeinDigest, org.bouncycastle.crypto.macs.SkeinMac

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
PARAM_TYPE_CONFIG

The parameter type for the Skein configuration block: 4.

public static final int
PARAM_TYPE_KEY

The parameter type for a secret key, supporting MAC or KDF functions: 0.

public static final int
PARAM_TYPE_KEY_IDENTIFIER

The parameter type for a key identifier string: 16.

public static final int
PARAM_TYPE_MESSAGE

The parameter type for the message: 48.

public static final int
PARAM_TYPE_NONCE

The parameter type for a nonce: 20.

public static final int
PARAM_TYPE_OUTPUT

The parameter type for the output transformation: 63.

public static final int
PARAM_TYPE_PERSONALISATION

The parameter type for a personalisation string: 8.

public static final int
PARAM_TYPE_PUBLIC_KEY

The parameter type for a public key: 12.

private Map<K, V>

Constructor Summary

AccessConstructor and Description
public
private
SkeinParameterSpec(Map<K, V> parameters)

Method Summary

Modifier and TypeMethod and Description
public byte[]
getKey()

Obtains the value of the key parameter, or null if not set.

public byte[]
getKeyIdentifier()

Obtains the value of the key identifier parameter, or null if not set.

public byte[]
getNonce()

Obtains the value of the nonce parameter, or null if not set.

public Map<K, V>
getParameters()

Obtains a map of type (Integer) to value (byte[]) for the parameters tracked in this object.

public byte[]
getPersonalisation()

Obtains the value of the personalisation parameter, or null if not set.

public byte[]
getPublicKey()

Obtains the value of the public key parameter, or null if not set.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PARAM_TYPE_CONFIGback to summary
public static final int PARAM_TYPE_CONFIG

The parameter type for the Skein configuration block: 4.

PARAM_TYPE_KEYback to summary
public static final int PARAM_TYPE_KEY

The parameter type for a secret key, supporting MAC or KDF functions: 0.

PARAM_TYPE_KEY_IDENTIFIERback to summary
public static final int PARAM_TYPE_KEY_IDENTIFIER

The parameter type for a key identifier string: 16.

PARAM_TYPE_MESSAGEback to summary
public static final int PARAM_TYPE_MESSAGE

The parameter type for the message: 48.

PARAM_TYPE_NONCEback to summary
public static final int PARAM_TYPE_NONCE

The parameter type for a nonce: 20.

PARAM_TYPE_OUTPUTback to summary
public static final int PARAM_TYPE_OUTPUT

The parameter type for the output transformation: 63.

PARAM_TYPE_PERSONALISATIONback to summary
public static final int PARAM_TYPE_PERSONALISATION

The parameter type for a personalisation string: 8.

PARAM_TYPE_PUBLIC_KEYback to summary
public static final int PARAM_TYPE_PUBLIC_KEY

The parameter type for a public key: 12.

parametersback to summary
private Map<K, V> parameters

Constructor Detail

SkeinParameterSpecback to summary
public SkeinParameterSpec()
SkeinParameterSpecback to summary
private SkeinParameterSpec(Map<K, V> parameters)

Method Detail

getKeyback to summary
public byte[] getKey()

Obtains the value of the key parameter, or null if not set.

getKeyIdentifierback to summary
public byte[] getKeyIdentifier()

Obtains the value of the key identifier parameter, or null if not set.

getNonceback to summary
public byte[] getNonce()

Obtains the value of the nonce parameter, or null if not set.

getParametersback to summary
public Map<K, V> getParameters()

Obtains a map of type (Integer) to value (byte[]) for the parameters tracked in this object.

getPersonalisationback to summary
public byte[] getPersonalisation()

Obtains the value of the personalisation parameter, or null if not set.

getPublicKeyback to summary
public byte[] getPublicKey()

Obtains the value of the public key parameter, or null if not set.

org.bouncycastle.jcajce.spec back to summary

public Class SkeinParameterSpec.Builder

extends Object
Class Inheritance

A builder for org.bouncycastle.jcajce.spec.SkeinParameterSpec.

Field Summary

Modifier and TypeField and Description
private Map<K, V>

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public SkeinParameterSpec
build()

Constructs a new org.bouncycastle.jcajce.spec.SkeinParameterSpec instance with the parameters provided to this builder.

public SkeinParameterSpec.Builder

Returns:

the current builder instance.
set
(int
the type of the parameter, in the range 5..62.
type
,
byte[]
the byte sequence of the parameter.
value
)

Sets a parameters to apply to the Skein hash function.

public SkeinParameterSpec.Builder
public SkeinParameterSpec.Builder

Returns:

the current builder instance.
setKeyIdentifier
(byte[] keyIdentifier)

Sets the org.bouncycastle.jcajce.spec.SkeinParameterSpec#PARAM_TYPE_KEY_IDENTIFIER parameter.

public SkeinParameterSpec.Builder

Returns:

the current builder instance.
setNonce
(byte[] nonce)

Sets the org.bouncycastle.jcajce.spec.SkeinParameterSpec#PARAM_TYPE_NONCE parameter.

public SkeinParameterSpec.Builder
public SkeinParameterSpec.Builder

Returns:

the current builder instance.
setPersonalisation
(Date
the date the personalised application of the Skein was defined.
date
,
String
the email address of the creation of the personalised application.
emailAddress
,
String
an arbitrary personalisation string distinguishing the application.
distinguisher
)

Implements the recommended personalisation format for Skein defined in Section 4.11 of the Skein 1.3 specification.

public SkeinParameterSpec.Builder

Returns:

the current builder instance.
setPersonalisation
(Date
the date the personalised application of the Skein was defined.
date
,
Locale
locale to be used for date interpretation.
dateLocale
,
String
the email address of the creation of the personalised application.
emailAddress
,
String
an arbitrary personalisation string distinguishing the application.
distinguisher
)

Implements the recommended personalisation format for Skein defined in Section 4.11 of the Skein 1.3 specification.

public SkeinParameterSpec.Builder

Returns:

the current builder instance.
setPublicKey
(byte[] publicKey)

Sets the org.bouncycastle.jcajce.spec.SkeinParameterSpec#PARAM_TYPE_KEY_IDENTIFIER parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parametersback to summary
private Map<K, V> parameters

Constructor Detail

Builderback to summary
public Builder()
Builderback to summary
public Builder(SkeinParameterSpec params)

Method Detail

buildback to summary
public SkeinParameterSpec build()

Constructs a new org.bouncycastle.jcajce.spec.SkeinParameterSpec instance with the parameters provided to this builder.

setback to summary
public SkeinParameterSpec.Builder set(int type, byte[] value)

Sets a parameters to apply to the Skein hash function.
Parameter types must be in the range 0,5..62, and cannot use the value 48 (reserved for message body).

Parameters with type < 48 are processed before the message content, parameters with type > 48 are processed after the message and prior to output.

Parameters
type:int

the type of the parameter, in the range 5..62.

value:byte[]

the byte sequence of the parameter.

Returns:SkeinParameterSpec.Builder

the current builder instance.

setKeyback to summary
public SkeinParameterSpec.Builder setKey(byte[] key)

Sets the org.bouncycastle.jcajce.spec.SkeinParameterSpec#PARAM_TYPE_KEY parameter.

setKeyIdentifierback to summary
public SkeinParameterSpec.Builder setKeyIdentifier(byte[] keyIdentifier)

Sets the org.bouncycastle.jcajce.spec.SkeinParameterSpec#PARAM_TYPE_KEY_IDENTIFIER parameter.

Returns:SkeinParameterSpec.Builder

the current builder instance.

setNonceback to summary
public SkeinParameterSpec.Builder setNonce(byte[] nonce)

Sets the org.bouncycastle.jcajce.spec.SkeinParameterSpec#PARAM_TYPE_NONCE parameter.

Returns:SkeinParameterSpec.Builder

the current builder instance.

setPersonalisationback to summary
public SkeinParameterSpec.Builder setPersonalisation(byte[] personalisation)

Sets the org.bouncycastle.jcajce.spec.SkeinParameterSpec#PARAM_TYPE_PERSONALISATION parameter.

setPersonalisationback to summary
public SkeinParameterSpec.Builder setPersonalisation(Date date, String emailAddress, String distinguisher)

Implements the recommended personalisation format for Skein defined in Section 4.11 of the Skein 1.3 specification.

The format is YYYYMMDD email@address distinguisher, encoded to a byte sequence using UTF-8 encoding.

Parameters
date:Date

the date the personalised application of the Skein was defined.

emailAddress:String

the email address of the creation of the personalised application.

distinguisher:String

an arbitrary personalisation string distinguishing the application.

Returns:SkeinParameterSpec.Builder

the current builder instance.

setPersonalisationback to summary
public SkeinParameterSpec.Builder setPersonalisation(Date date, Locale dateLocale, String emailAddress, String distinguisher)

Implements the recommended personalisation format for Skein defined in Section 4.11 of the Skein 1.3 specification. You may need to use this method if the default locale doesn't use a Gregorian calender so that the GeneralizedTime produced is compatible implementations.

The format is YYYYMMDD email@address distinguisher, encoded to a byte sequence using UTF-8 encoding.

Parameters
date:Date

the date the personalised application of the Skein was defined.

dateLocale:Locale

locale to be used for date interpretation.

emailAddress:String

the email address of the creation of the personalised application.

distinguisher:String

an arbitrary personalisation string distinguishing the application.

Returns:SkeinParameterSpec.Builder

the current builder instance.

setPublicKeyback to summary
public SkeinParameterSpec.Builder setPublicKey(byte[] publicKey)

Sets the org.bouncycastle.jcajce.spec.SkeinParameterSpec#PARAM_TYPE_KEY_IDENTIFIER parameter.

Returns:SkeinParameterSpec.Builder

the current builder instance.