Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.security

Class SignatureSpi

java.lang.Object
|
+--java.security.SignatureSpi


public abstract class SignatureSpi

extends Object

SignatureSpi defines the Service Provider Interface (SPI) for the Signature class. The signature class provides an interface to a digital signature algorithm. Digital signatures are used for authentication and integrity of data.

Since:Author:

Field Summary

java.security.SecureRandomappRandom

Source of randomness

Constructor Summary

SignatureSpi()

Creates a new instance of SignatureSpi.

Method Summary

java.lang.Objectclone()

Returns a clone if cloneable.
java.lang.ObjectengineGetParameter(java.lang.String param)

Gets the value for the specified algorithm parameter.
voidengineInitSign(java.security.PrivateKey privateKey)

Initializes this class with the private key for signing purposes.
voidengineInitSign(java.security.PrivateKey privateKey, java.security.SecureRandom random)

Initializes this class with the private key and source of randomness for signing purposes.
voidengineInitVerify(java.security.PublicKey publicKey)

Initializes this class with the public key for verification purposes.
voidengineSetParameter(java.lang.String param, java.lang.Object value)

Sets the specified algorithm parameter to the specified value.
voidengineSetParameter(java.security.spec.AlgorithmParameterSpec params)

Sets the signature engine with the specified AlgorithmParameterSpec; This cannot be abstract backward compatibility reasons By default this always throws UnsupportedOperationException if not overridden;
byte[]engineSign()

Returns the signature bytes of all the data fed to this class.
intengineSign(byte[] outbuf, int offset, int len)

Generates signature bytes of all the data fed to this class and outputs it to the passed array.
voidengineUpdate(byte b)

Updates the data to be signed or verified with the specified byte.
voidengineUpdate(byte[] b, int off, int len)

Updates the data to be signed or verified with the specified bytes.
booleanengineVerify(byte[] sigBytes)

Verifies the passed signature.

Field Details

appRandom

protected SecureRandom appRandom

Source of randomness


Constructor Details

SignatureSpi

public SignatureSpi()

Creates a new instance of SignatureSpi.


Method Details

clone

public Object clone()

Returns a clone if cloneable.

Returns:

Throws:


engineGetParameter

protected Object engineGetParameter(java.lang.String param)

Gets the value for the specified algorithm parameter.

Parameters:

Returns:

Throws:


engineInitSign

protected void engineInitSign(java.security.PrivateKey privateKey)

Initializes this class with the private key for signing purposes.

Parameters:

Throws:


engineInitSign

protected void engineInitSign(java.security.PrivateKey privateKey, java.security.SecureRandom random)

Initializes this class with the private key and source of randomness for signing purposes. This cannot be abstract backward compatibility reasons

Since:Parameters:

Throws:


engineInitVerify

protected void engineInitVerify(java.security.PublicKey publicKey)

Initializes this class with the public key for verification purposes.

Parameters:

Throws:


engineSetParameter

protected void engineSetParameter(java.lang.String param, java.lang.Object value)

Sets the specified algorithm parameter to the specified value.

Parameters:

Throws:


engineSetParameter

protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params)

Sets the signature engine with the specified AlgorithmParameterSpec; This cannot be abstract backward compatibility reasons By default this always throws UnsupportedOperationException if not overridden;

Parameters:

Throws:


engineSign

protected byte[] engineSign()

Returns the signature bytes of all the data fed to this class. The format of the output depends on the underlying signature algorithm.

Returns:

Throws:


engineSign

protected int engineSign(byte[] outbuf, int offset, int len)

Generates signature bytes of all the data fed to this class and outputs it to the passed array. The format of the output depends on the underlying signature algorithm. This cannot be abstract backward compatibility reasons. After calling this method, the signature is reset to its initial state and can be used to generate additional signatures.

Since:Parameters:

Returns:

Throws:


engineUpdate

protected void engineUpdate(byte b)

Updates the data to be signed or verified with the specified byte.

Parameters:

Throws:


engineUpdate

protected void engineUpdate(byte[] b, int off, int len)

Updates the data to be signed or verified with the specified bytes.

Parameters:

Throws:


engineVerify

protected boolean engineVerify(byte[] sigBytes)

Verifies the passed signature.

Parameters:

Returns:

Throws: