Methods Summary |
---|
public java.lang.Object | clone()
if (this instanceof Cloneable) {
return super.clone();
} else {
throw new CloneNotSupportedException();
}
|
protected abstract java.lang.Object | engineGetParameter(java.lang.String param)Returns the value of the parameter with the specified name.
|
protected java.security.AlgorithmParameters | engineGetParameters()Returns the {@code AlgorithmParameters} of this {@link SignatureSpi}
instance.
throw new UnsupportedOperationException();
|
protected abstract void | engineInitSign(java.security.PrivateKey privateKey)Initializes this {@code SignatureSpi} instance for signing, using the
private key of the identity whose signature is going to be generated.
|
protected void | engineInitSign(java.security.PrivateKey privateKey, java.security.SecureRandom random)Initializes this {@code SignatureSpi} instance for signing, using the
private key of the identity whose signature is going to be generated and
the specified source of randomness.
appRandom = random;
engineInitSign(privateKey);
|
protected abstract void | engineInitVerify(java.security.PublicKey publicKey)Initializes this {@code SignatureSpi} instance for signature
verification, using the public key of the identity whose signature is
going to be verified.
|
protected abstract void | engineSetParameter(java.lang.String param, java.lang.Object value)Sets the specified parameter to the given value.
|
protected void | engineSetParameter(java.security.spec.AlgorithmParameterSpec params)Sets the specified {@code AlgorithmParameterSpec}.
throw new UnsupportedOperationException();
|
protected abstract byte[] | engineSign()Generates and returns the signature of all updated data.
This {@code SignatureSpi} instance is reset to the state of its last
initialization for signing and thus can be used for another signature
from the same identity.
|
protected int | engineSign(byte[] outbuf, int offset, int len)Generates and stores the signature of all updated data in the provided
{@code byte[]} at the specified position with the specified length.
This {@code SignatureSpi} instance is reset to the state of its last
initialization for signing and thus can be used for another signature
from the same identity.
byte tmp[] = engineSign();
if (tmp == null) {
return 0;
}
if (len < tmp.length) {
throw new SignatureException(Messages.getString("security.2D")); //$NON-NLS-1$
}
if (offset < 0) {
throw new SignatureException(Messages.getString("security.1C")); //$NON-NLS-1$
}
if (offset + len > outbuf.length) {
throw new SignatureException(Messages.getString("security.05")); //$NON-NLS-1$
}
System.arraycopy(tmp, 0, outbuf, offset, tmp.length);
return tmp.length;
|
protected abstract void | engineUpdate(byte b)Updates the data to be verified or to be signed, using the specified
{@code byte}.
|
protected abstract void | engineUpdate(byte[] b, int off, int len)Updates the data to be verified or to be signed, using the given {@code
byte[]}, starting form the specified index for the specified length.
|
protected void | engineUpdate(java.nio.ByteBuffer input)Updates the data to be verified or to be signed, using the specified
{@code ByteBuffer}.
if (!input.hasRemaining()) {
return;
}
byte[] tmp;
if (input.hasArray()) {
tmp = input.array();
int offset = input.arrayOffset();
int position = input.position();
int limit = input.limit();
try {
engineUpdate(tmp, offset + position, limit - position);
} catch (SignatureException e) {
throw new RuntimeException(e); //Wrap SignatureException
}
input.position(limit);
} else {
tmp = new byte[input.limit() - input.position()];
input.get(tmp);
try {
engineUpdate(tmp, 0, tmp.length);
} catch (SignatureException e) {
throw new RuntimeException(e); //Wrap SignatureException
}
}
|
protected boolean | engineVerify(byte[] sigBytes, int offset, int length)Indicates whether the given {@code sigBytes} starting at index {@code
offset} with {@code length} bytes can be verified using the public key or
a certificate of the signer.
This {@code SignatureSpi} instance is reset to the state of its last
initialization for verifying and thus can be used to verify another
signature of the same signer.
byte tmp[] = new byte[length];
System.arraycopy(sigBytes, offset, tmp, 0, length);
return engineVerify(tmp);
|
protected abstract boolean | engineVerify(byte[] sigBytes)Indicates whether the given {@code sigBytes} can be verified using the
public key or a certificate of the signer.
This {@code SignatureSpi} instance is reset to the state of its last
initialization for verifying and thus can be used to verify another
signature of the same signer.
|