Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.params

public Class SkeinParameters

extends Object
implements CipherParameters
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.CipherParameters
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStreamWriter, java.text.DateFormat, .SimpleDateFormat, java.util.Date, .Enumeration, .Hashtable, .Locale, org.bouncycastle.crypto.CipherParameters, org.bouncycastle.crypto.digests.SkeinDigest, .SkeinEngine, org.bouncycastle.crypto.macs.SkeinMac, org.bouncycastle.util.Integers

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

Parameterised Skein can be used for:

See Also
SkeinEngine, SkeinDigest, 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 Hashtable<K, V>

Constructor Summary

AccessConstructor and Description
public
private
SkeinParameters(final Hashtable<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 Hashtable<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 Hashtable<K, V> parameters

Constructor Detail

SkeinParametersback to summary
public SkeinParameters()
SkeinParametersback to summary
private SkeinParameters(final Hashtable<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 Hashtable<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.crypto.params back to summary

public Class SkeinParameters.Builder

extends Object
Class Inheritance

A builder for SkeinParameters.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public
Builder(Hashtable<K, V> paramsMap)

public

Method Summary

Modifier and TypeMethod and Description
public SkeinParameters
build()

Constructs a new SkeinParameters instance with the parameters provided to this builder.

public SkeinParameters.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 SkeinParameters.Builder
setKey(byte[] key)

Sets the PARAM_TYPE_KEY parameter.

public SkeinParameters.Builder
setKeyIdentifier(byte[] keyIdentifier)

Sets the SkeinParameters#PARAM_TYPE_KEY_IDENTIFIER parameter.

public SkeinParameters.Builder
setNonce(byte[] nonce)

Sets the SkeinParameters#PARAM_TYPE_NONCE parameter.

public SkeinParameters.Builder
setPersonalisation(byte[] personalisation)

Sets the PARAM_TYPE_PERSONALISATION parameter.

public SkeinParameters.Builder

Returns:

the current builder.
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 SkeinParameters.Builder

Returns:

the current builder.
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 SkeinParameters.Builder
setPublicKey(byte[] publicKey)

Sets the SkeinParameters#PARAM_TYPE_KEY_IDENTIFIER parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parametersback to summary
private Hashtable<K, V> parameters

Constructor Detail

Builderback to summary
public Builder()
Builderback to summary
public Builder(Hashtable<K, V> paramsMap)
Builderback to summary
public Builder(SkeinParameters params)

Method Detail

buildback to summary
public SkeinParameters build()

Constructs a new SkeinParameters instance with the parameters provided to this builder.

setback to summary
public SkeinParameters.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 PARAM_TYPE_MESSAGE (reserved for message body).

Parameters with type < PARAM_TYPE_MESSAGE are processed before the message content, parameters with type > PARAM_TYPE_MESSAGE 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:SkeinParameters.Builder

the current builder instance.

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

Sets the PARAM_TYPE_KEY parameter.

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

Sets the SkeinParameters#PARAM_TYPE_KEY_IDENTIFIER parameter.

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

Sets the SkeinParameters#PARAM_TYPE_NONCE parameter.

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

Sets the PARAM_TYPE_PERSONALISATION parameter.

setPersonalisationback to summary
public SkeinParameters.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:SkeinParameters.Builder

the current builder.

setPersonalisationback to summary
public SkeinParameters.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:SkeinParameters.Builder

the current builder.

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

Sets the SkeinParameters#PARAM_TYPE_KEY_IDENTIFIER parameter.