java.security
Class Signature
java.lang.Object
java.security.SignatureSpi
java.security.Signature
public abstract class Signature
- extends SignatureSpi
|
Method Summary |
Object |
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver. |
String |
getAlgorithm()
|
static Signature |
getInstance(String algorithm)
|
static Signature |
getInstance(String algorithm,
Provider provider)
|
static Signature |
getInstance(String algorithm,
String provider)
|
Object |
getParameter(String param)
Deprecated. There is no generally accepted parameter naming convention. |
AlgorithmParameters |
getParameters()
|
Provider |
getProvider()
|
void |
initSign(PrivateKey privateKey)
|
void |
initSign(PrivateKey privateKey,
SecureRandom random)
|
void |
initVerify(Certificate certificate)
|
void |
initVerify(PublicKey publicKey)
|
void |
setParameter(AlgorithmParameterSpec params)
|
void |
setParameter(String param,
Object value)
Deprecated. Use setParameter |
byte[] |
sign()
|
int |
sign(byte[] outbuf,
int offset,
int len)
|
String |
toString()
Returns a string containing a concise, human-readable description of the
receiver. |
void |
update(byte b)
|
void |
update(byte[] data)
|
void |
update(byte[] data,
int off,
int len)
|
void |
update(ByteBuffer data)
|
boolean |
verify(byte[] signature)
|
boolean |
verify(byte[] signature,
int offset,
int length)
|
| Methods inherited from class java.security.SignatureSpi |
engineGetParameter, engineGetParameters, engineInitSign, engineInitSign, engineInitVerify, engineSetParameter, engineSetParameter, engineSign, engineSign, engineUpdate, engineUpdate, engineUpdate, engineVerify, engineVerify |
UNINITIALIZED
protected static final int UNINITIALIZED
- See Also:
- Constant Field Values
SIGN
protected static final int SIGN
- See Also:
- Constant Field Values
VERIFY
protected static final int VERIFY
- See Also:
- Constant Field Values
state
protected int state
Signature
protected Signature(String algorithm)
getInstance
public static Signature getInstance(String algorithm)
throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
getInstance
public static Signature getInstance(String algorithm,
String provider)
throws NoSuchAlgorithmException,
NoSuchProviderException
- Throws:
NoSuchAlgorithmException
NoSuchProviderException
getInstance
public static Signature getInstance(String algorithm,
Provider provider)
throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
getProvider
public final Provider getProvider()
getAlgorithm
public final String getAlgorithm()
initVerify
public final void initVerify(PublicKey publicKey)
throws InvalidKeyException
- Throws:
InvalidKeyException
initVerify
public final void initVerify(Certificate certificate)
throws InvalidKeyException
- Throws:
InvalidKeyException
initSign
public final void initSign(PrivateKey privateKey)
throws InvalidKeyException
- Throws:
InvalidKeyException
initSign
public final void initSign(PrivateKey privateKey,
SecureRandom random)
throws InvalidKeyException
- Throws:
InvalidKeyException
sign
public final byte[] sign()
throws SignatureException
- Throws:
SignatureException
sign
public final int sign(byte[] outbuf,
int offset,
int len)
throws SignatureException
- Throws:
SignatureException
verify
public final boolean verify(byte[] signature)
throws SignatureException
- Throws:
SignatureException
verify
public final boolean verify(byte[] signature,
int offset,
int length)
throws SignatureException
- Throws:
SignatureException
update
public final void update(byte b)
throws SignatureException
- Throws:
SignatureException
update
public final void update(byte[] data)
throws SignatureException
- Throws:
SignatureException
update
public final void update(byte[] data,
int off,
int len)
throws SignatureException
- Throws:
SignatureException
update
public final void update(ByteBuffer data)
throws SignatureException
- Throws:
SignatureException
toString
public String toString()
- Description copied from class:
Object
- Returns a string containing a concise, human-readable description of the
receiver.
- Overrides:
toString in class Object
- Returns:
- String a printable representation for the receiver.
setParameter
public final void setParameter(String param,
Object value)
throws InvalidParameterException
- Deprecated. Use
setParameter
- Throws:
InvalidParameterException
setParameter
public final void setParameter(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException
- Throws:
InvalidAlgorithmParameterException
getParameters
public final AlgorithmParameters getParameters()
getParameter
public final Object getParameter(String param)
throws InvalidParameterException
- Deprecated. There is no generally accepted parameter naming convention.
- Throws:
InvalidParameterException
clone
public Object clone()
throws CloneNotSupportedException
- Description copied from class:
Object
- Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
Classes which wish to support cloning must specify that they implement
the Cloneable interface, since the implementation checks for this.
- Overrides:
clone in class SignatureSpi
- Returns:
- Object a shallow copy of this object.
- Throws:
CloneNotSupportedException - if the receiver's class does not
implement the interface Cloneable.
Please submit a feedback, bug or feature