API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.security. Signature View Source
Author(s)
Benjamin Renaud
Since
Version
1.103, 04/21/06
Serial
Hierarchy
 Object
      SignatureSpi
          Signature
Implements
Subclasses
Description
publicabstract abstract class Signature
  This Signature class is used to provide applications the functionality of a digital signature algorithm.
See also:   
Constructors
protected Signature (String algorithm)
  Creates a Signature object for the specified algorithm.
Methods
Hide/Show inherited methods
pack-private void chooseFirstProvider ()
public Object clone () throws CloneNotSupportedException [Overrides SignatureSpi]
  Returns a clone if the implementation is cloneable.
@Deprecated
protectedabstract Object engineGetParameter (String param) throws InvalidParameterException [Inherited From SignatureSpi]
  Gets the value of the specified algorithm parameter.
protected AlgorithmParameters engineGetParameters () [Inherited From SignatureSpi]
  This method is overridden by providers to return the parameters used with this signature engine, or null if this signature engine does not use any parameters.
protectedabstract void engineInitSign (PrivateKey privateKey) throws InvalidKeyException [Inherited From SignatureSpi]
  Initializes this signature object with the specified private key for signing operations.
protected void engineInitSign (PrivateKey privateKey, SecureRandom random) throws InvalidKeyException [Inherited From SignatureSpi]
  Initializes this signature object with the specified private key and source of randomness for signing operations.
protectedabstract void engineInitVerify (PublicKey publicKey) throws InvalidKeyException [Inherited From SignatureSpi]
  Initializes this signature object with the specified public key for verification operations.
protected void engineSetParameter (AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException [Inherited From SignatureSpi]
  This method is overridden by providers to initialize this signature engine with the specified parameter set.
@Deprecated
protectedabstract void engineSetParameter (String param, Object value) throws InvalidParameterException [Inherited From SignatureSpi]
  Sets the specified algorithm parameter to the specified value.
protectedabstract byte engineSign () throws SignatureException [Inherited From SignatureSpi]
  Returns the signature bytes of all the data updated so far.
protected int engineSign (byte[] outbuf, int offset, int len) throws SignatureException [Inherited From SignatureSpi]
  Finishes this signature operation and stores the resulting signature bytes in the provided buffer outbuf, starting at offset.
protectedabstract void engineUpdate (byte b) throws SignatureException [Inherited From SignatureSpi]
  Updates the data to be signed or verified using the specified byte.
protectedabstract void engineUpdate (byte[] b, int off, int len) throws SignatureException [Inherited From SignatureSpi]
  Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
protected void engineUpdate (ByteBuffer input) [Inherited From SignatureSpi]
  Updates the data to be signed or verified using the specified ByteBuffer.
protectedabstract boolean engineVerify (byte[] sigBytes) throws SignatureException [Inherited From SignatureSpi]
  Verifies the passed-in signature.
protected boolean engineVerify (byte[] sigBytes, int offset, int length) throws SignatureException [Inherited From SignatureSpi]
  Verifies the passed-in signature in the specified array of bytes, starting at the specified offset.
publicfinal String getAlgorithm ()
  Returns the name of the algorithm for this signature object.
publicstatic Signature getInstance (String algorithm) throws NoSuchAlgorithmException
  Returns a Signature object that implements the specified signature algorithm.
publicstatic Signature getInstance (String algorithm, Provider provider) throws NoSuchAlgorithmException
  Returns a Signature object that implements the specified signature algorithm.
publicstatic Signature getInstance (String algorithm, String provider) throws NoSuchAlgorithmException NoSuchProviderException
  Returns a Signature object that implements the specified signature algorithm.
@Deprecated
publicfinal Object getParameter (String param) throws InvalidParameterException
  Gets the value of the specified algorithm parameter.
publicfinal AlgorithmParameters getParameters ()
  Returns the parameters used with this signature object.
publicfinal Provider getProvider ()
  Returns the provider of this signature object.
publicfinal void initSign (PrivateKey privateKey) throws InvalidKeyException
  Initialize this object for signing.
publicfinal void initSign (PrivateKey privateKey, SecureRandom random) throws InvalidKeyException
  Initialize this object for signing.
publicfinal void initVerify (Certificate certificate) throws InvalidKeyException
  Initializes this object for verification, using the public key from the given certificate.
publicfinal void initVerify (PublicKey publicKey) throws InvalidKeyException
  Initializes this object for verification.
publicfinal void setParameter (AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException
  Initializes this signature engine with the specified parameter set.
@Deprecated
publicfinal void setParameter (String param, Object value) throws InvalidParameterException
  Sets the specified algorithm parameter to the specified value.
publicfinal byte sign () throws SignatureException
  Returns the signature bytes of all the data updated.
publicfinal int sign (byte[] outbuf, int offset, int len) throws SignatureException
  Finishes the signature operation and stores the resulting signature bytes in the provided buffer outbuf, starting at offset.
public String toString ()
  Returns a string representation of this signature object, providing information that includes the state of the object and the name of the algorithm used.
publicfinal void update (byte b) throws SignatureException
  Updates the data to be signed or verified by a byte.
publicfinal void update (byte[] data) throws SignatureException
  Updates the data to be signed or verified, using the specified array of bytes.
publicfinal void update (byte[] data, int off, int len) throws SignatureException
  Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
publicfinal void update (ByteBuffer data) throws SignatureException
  Updates the data to be signed or verified using the specified ByteBuffer.
publicfinal boolean verify (byte[] signature) throws SignatureException
  Verifies the passed-in signature.
publicfinal boolean verify (byte[] signature, int offset, int length) throws SignatureException
  Verifies the passed-in signature in the specified array of bytes, starting at the specified offset.
Fields
Hide/Show inherited fields
protected SecureRandom appRandom [Inherited From SignatureSpi]
Application-specified source of randomness.
pack-private Provider provider
protectedfinalstatic int SIGN = "2"
Possible Signature.state value, signifying that this signature object has been initialized for signing.
protected int state
Current state of this signature object.
protectedfinalstatic int UNINITIALIZED = "0"
Possible Signature.state value, signifying that this signature object has not yet been initialized.
protectedfinalstatic int VERIFY = "3"
Possible Signature.state value, signifying that this signature object has been initialized for verification.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar