Home | History | Annotate | Download | only in security

Lines Matching refs:Signature

30  * {@code Signature} is an engine class which is capable of creating and
36 public abstract class Signature extends SignatureSpi {
39 private static final String SERVICE = "Signature";
51 * Constant that indicates that this {@code Signature} instance has not yet
57 * Constant that indicates that this {@code Signature} instance has been
63 * Constant that indicates that this {@code Signature} instance has been
69 * Represents the current state of this {@code Signature}. The three
76 * Constructs a new instance of {@code Signature} with the name of
82 protected Signature(String algorithm) {
87 * Returns a new instance of {@code Signature} that utilizes the specified
92 * @return a new instance of {@code Signature} that utilizes the specified
99 public static Signature getInstance(String algorithm)
107 if (spi instanceof Signature) {
108 Signature result = (Signature) spi;
117 * Returns a new instance of {@code Signature} that utilizes the specified
124 * @return a new instance of {@code Signature} that utilizes the specified
134 public static Signature getInstance(String algorithm, String provider)
150 * Returns a new instance of {@code Signature} that utilizes the specified
157 * @return a new instance of {@code Signature} that utilizes the specified
165 public static Signature getInstance(String algorithm, Provider provider)
176 private static Signature getSignatureInstance(String algorithm,
179 if (spi instanceof Signature) {
180 Signature result = (Signature) spi;
189 * Returns the provider associated with this {@code Signature}.
191 * @return the provider associated with this {@code Signature}.
198 * Returns the name of the algorithm of this {@code Signature}.
200 * @return the name of the algorithm of this {@code Signature}.
207 * Initializes this {@code Signature} instance for signature verification,
208 * using the public key of the identity whose signature is going to be
223 * Initializes this {@code Signature} instance for signature verification,
224 * using the certificate of the identity whose signature is going to be
232 * the certificate used to verify a signature.
260 throw new InvalidKeyException("The public key in the certificate cannot be used for digital signature purposes");
270 * Initializes this {@code Signature} instance for signing, using the
271 * private key of the identity whose signature is going to be generated.
285 * Initializes this {@code Signature} instance for signing, using the
286 * private key of the identity whose signature is going to be generated and
303 * Generates and returns the signature of all updated data.
305 * This {@code Signature} instance is reset to the state of its last
306 * initialization for signing and thus can be used for another signature
309 * @return the signature of all updated data.
311 * if this {@code Signature} instance is not initialized
316 throw new SignatureException("Signature object is not initialized properly");
322 * Generates and stores the signature of all updated data in the provided
325 * This {@code Signature} instance is reset to the state of its last
326 * initialization for signing and thus can be used for another signature
330 * the buffer to store the signature.
334 * the number of bytes allocated for the signature.
337 * if this {@code Signature} instance is not initialized
350 throw new SignatureException("Signature object is not initialized properly");
356 * Indicates whether the given {@code signature} can be verified using the
359 * This {@code Signature} instance is reset to the state of its last
361 * signature of the same signer.
363 * @param signature
364 * the signature to verify.
365 * @return {@code true} if the signature was verified, {@code false}
368 * if this {@code Signature} instance is not initialized
371 public final boolean verify(byte[] signature) throws SignatureException {
373 throw new SignatureException("Signature object is not initialized properly");
375 return engineVerify(signature);
379 * Indicates whether the given {@code signature} starting at index {@code
383 * This {@code Signature} instance is reset to the state of its last
385 * signature of the same signer.
387 * @param signature
388 * the {@code byte[]} containing the signature to verify.
390 * the start index in {@code signature} of the signature.
392 * the number of bytes allocated for the signature.
393 * @return {@code true} if the signature was verified, {@code false}
396 * if this {@code Signature} instance is not initialized
400 * to {@code signature}.
402 public final boolean verify(byte[] signature, int offset, int length)
405 throw new SignatureException("Signature object is not initialized properly");
407 if (signature == null || offset < 0 || length < 0 ||
408 offset + length > signature.length) {
411 return engineVerify(signature, offset, length);
421 * if this {@code Signature} instance is not initialized
426 throw new SignatureException("Signature object is not initialized properly");
438 * if this {@code Signature
443 throw new SignatureException("Signature object is not initialized properly");
459 * if this {@code Signature} instance is not initialized
465 throw new SignatureException("Signature object is not initialized properly");
481 * if this {@code Signature} instance is not initialized
486 throw new SignatureException("Signature object is not initialized properly");
493 * {@code Signature} including its algorithm and its state.
495 * @return a printable representation for this {@code Signature}.
499 return "SIGNATURE " + algorithm + " state: " + stateToString(state);
549 * Returns the {@code AlgorithmParameters} of this {@link Signature}
552 * @return the {@code AlgorithmParameters} of this {@link Signature}
568 * Signature} or an other error occures.
587 * Internal Signature implementation
590 private static class SignatureImpl extends Signature {