public abstract class Signature extends SignatureSpi
Modifier and Type | Field and Description |
---|---|
protected static int |
SIGN |
protected int |
state |
protected static int |
UNINITIALIZED |
protected static int |
VERIFY |
appRandom
Modifier | Constructor and Description |
---|---|
protected |
Signature(String algorithm) |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Default clone() method performs a "shallow" cloning of the instance.
|
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.
|
AlgorithmParameters |
getParameters() |
Provider |
getProvider() |
void |
initSign(PrivateKey prtKey) |
void |
initSign(PrivateKey prtKey,
SecureRandom rnd) |
void |
initVerify(Certificate certificate) |
void |
initVerify(PublicKey publicKey) |
void |
setParameter(AlgorithmParameterSpec params) |
void |
setParameter(String param,
Object value) |
byte[] |
sign() |
int |
sign(byte[] buf,
int offset,
int len) |
String |
toString()
Default String representation: overriden by many classes.
|
void |
update(byte b) |
void |
update(byte[] data) |
void |
update(byte[] data,
int off,
int len) |
boolean |
verify(byte[] signature) |
boolean |
verify(byte[] signature,
int offset,
int length) |
engineGetParameter, engineGetParameters, engineInitSign, engineInitSign, engineInitVerify, engineSetParameter, engineSetParameter, engineSign, engineSign, engineUpdate, engineUpdate, engineVerify, engineVerify
protected static final int SIGN
protected static final int UNINITIALIZED
protected static final int VERIFY
protected int state
protected Signature(String algorithm)
public static Signature getInstance(String algorithm) throws NoSuchAlgorithmException
NoSuchAlgorithmException
public static Signature getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
public static Signature getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException
NoSuchAlgorithmException
public Object clone() throws CloneNotSupportedException
Object
clone
in class SignatureSpi
CloneNotSupportedException
public final AlgorithmParameters getParameters()
public final boolean verify(byte[] signature, int offset, int length) throws SignatureException
SignatureException
public final String getAlgorithm()
public final Provider getProvider()
public final void initSign(PrivateKey prtKey) throws InvalidKeyException
InvalidKeyException
public final void initSign(PrivateKey prtKey, SecureRandom rnd) throws InvalidKeyException
InvalidKeyException
public final void initVerify(PublicKey publicKey) throws InvalidKeyException
InvalidKeyException
public final void initVerify(Certificate certificate) throws InvalidKeyException
InvalidKeyException
public final void setParameter(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException
public final byte[] sign() throws SignatureException
SignatureException
public final int sign(byte[] buf, int offset, int len) throws SignatureException
SignatureException
public String toString()
Object
public final void update(byte b) throws SignatureException
SignatureException
public final void update(byte[] data) throws SignatureException
SignatureException
public final void update(byte[] data, int off, int len) throws SignatureException
SignatureException
public final boolean verify(byte[] signature) throws SignatureException
SignatureException