summaryrefslogtreecommitdiffstats
path: root/pki/base/util/src/netscape/security/x509/X500Signer.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/util/src/netscape/security/x509/X500Signer.java')
-rw-r--r--pki/base/util/src/netscape/security/x509/X500Signer.java88
1 files changed, 45 insertions, 43 deletions
diff --git a/pki/base/util/src/netscape/security/x509/X500Signer.java b/pki/base/util/src/netscape/security/x509/X500Signer.java
index 93be4ba8..5d1180dd 100644
--- a/pki/base/util/src/netscape/security/x509/X500Signer.java
+++ b/pki/base/util/src/netscape/security/x509/X500Signer.java
@@ -23,47 +23,49 @@ import java.security.SignatureException;
import java.security.Signer;
/**
- * This class provides a binding between a Signature object and an
- * authenticated X.500 name (from an X.509 certificate chain), which
- * is needed in many public key signing applications.
- *
- * <P>The name of the signer is important, both because knowing it is the
- * whole point of the signature, and because the associated X.509 certificate
- * is always used to verify the signature.
- *
- * <P><em>The X.509 certificate chain is temporarily not associated with
+ * This class provides a binding between a Signature object and an authenticated
+ * X.500 name (from an X.509 certificate chain), which is needed in many public
+ * key signing applications.
+ *
+ * <P>
+ * The name of the signer is important, both because knowing it is the whole
+ * point of the signature, and because the associated X.509 certificate is
+ * always used to verify the signature.
+ *
+ * <P>
+ * <em>The X.509 certificate chain is temporarily not associated with
* the signer, but this omission will be resolved.</em>
- *
+ *
* @version 1.18
- *
+ *
* @author David Brownell
* @author Amit Kapoor
* @author Hemma Prafullchandra
*/
-public final class X500Signer extends Signer
-{
+public final class X500Signer extends Signer {
/**
*
*/
private static final long serialVersionUID = -3148659822293810158L;
+
/**
- * Called for each chunk of the data being signed. That
- * is, you can present the data in many chunks, so that
- * it doesn't need to be in a single sequential buffer.
- *
+ * Called for each chunk of the data being signed. That is, you can present
+ * the data in many chunks, so that it doesn't need to be in a single
+ * sequential buffer.
+ *
* @param buf buffer holding the next chunk of the data to be signed
* @param offset starting point of to-be-signed data
* @param len how many bytes of data are to be signed
* @exception SignatureException on errors.
*/
public void update(byte buf[], int offset, int len)
- throws SignatureException {
- sig.update (buf, offset, len);
+ throws SignatureException {
+ sig.update(buf, offset, len);
}
/**
* Produces the signature for the data processed by update().
- *
+ *
* @exception SignatureException on errors.
*/
public byte[] sign() throws SignatureException {
@@ -73,43 +75,43 @@ public final class X500Signer extends Signer
/**
* Returns the algorithm used to sign.
*/
- public AlgorithmId getAlgorithmId() {
+ public AlgorithmId getAlgorithmId() {
return algid;
}
/**
* Returns the name of the signing agent.
*/
- public X500Name getSigner() {
+ public X500Name getSigner() {
return agent;
}
/*
- * Constructs a binding between a signature and an X500 name
- * from an X.509 certificate.
+ * Constructs a binding between a signature and an X500 name from an X.509
+ * certificate.
*/
- // package private ----hmmmmm ?????
+ // package private ----hmmmmm ?????
public X500Signer(Signature sig, X500Name agent) {
- if (sig == null || agent == null)
- throw new IllegalArgumentException ("null parameter");
+ if (sig == null || agent == null)
+ throw new IllegalArgumentException("null parameter");
- this.sig = sig;
- this.agent = agent;
+ this.sig = sig;
+ this.agent = agent;
- try {
- this.algid = AlgorithmId.getAlgorithmId(sig.getAlgorithm());
- String alg = sig.getAlgorithm();
- if( alg.equals("DSA") ) {
- alg = "SHA1withDSA";
- }
- this.algid = AlgorithmId.getAlgorithmId(alg);
+ try {
+ this.algid = AlgorithmId.getAlgorithmId(sig.getAlgorithm());
+ String alg = sig.getAlgorithm();
+ if (alg.equals("DSA")) {
+ alg = "SHA1withDSA";
+ }
+ this.algid = AlgorithmId.getAlgorithmId(alg);
- } catch (NoSuchAlgorithmException e) {
- throw new RuntimeException("internal error! " + e.getMessage());
- }
+ } catch (NoSuchAlgorithmException e) {
+ throw new RuntimeException("internal error! " + e.getMessage());
+ }
}
-
- private Signature sig;
- private X500Name agent; // XXX should be X509CertChain
- private AlgorithmId algid;
+
+ private Signature sig;
+ private X500Name agent; // XXX should be X509CertChain
+ private AlgorithmId algid;
}