diff options
Diffstat (limited to 'base/util/src/netscape/security/x509/X509Key.java')
-rw-r--r-- | base/util/src/netscape/security/x509/X509Key.java | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/base/util/src/netscape/security/x509/X509Key.java b/base/util/src/netscape/security/x509/X509Key.java index a8253c0d8..5c8ac3a88 100644 --- a/base/util/src/netscape/security/x509/X509Key.java +++ b/base/util/src/netscape/security/x509/X509Key.java @@ -39,13 +39,13 @@ import netscape.security.util.DerValue; * certificate. Includes a description of the algorithm to be used * with the key; these keys normally are used as * "SubjectPublicKeyInfo". - * + * * <P> * While this class can represent any kind of X.509 key, it may be desirable to provide subclasses which understand how * to parse keying data. For example, RSA public keys have two members, one for the public modulus and one for the prime * exponent. If such a class is provided, it is used when parsing X.509 keys. If one is not provided, the key still * parses correctly. - * + * * @version 1.74, 97/12/10 * @author David Brownell */ @@ -88,12 +88,12 @@ public class X509Key implements PublicKey { * the runtime environment is configured with a specific class for * this kind of key, a subclass is returned. Otherwise, a generic * X509Key object is returned. - * + * * <P> * This mechanism gurantees that keys (and algorithms) may be freely manipulated and transferred, without risk of * losing information. Also, when a key (or algorithm) needs some special handling, that specific need can be * accomodated. - * + * * @param in the DER-encoded SubjectPublicKeyInfo value * @exception IOException on data format errors */ @@ -123,11 +123,11 @@ public class X509Key implements PublicKey { * keys encapsulate two unsigned integers (modulus and exponent) as * DER values within the <code>key</code> bits; Diffie-Hellman and * DSS/DSA keys encapsulate a single unsigned integer. - * + * * <P> * This function is called when creating X.509 SubjectPublicKeyInfo values using the X509Key member functions, such * as <code>parse</code> and <code>decode</code>. - * + * * @exception IOException on parsing errors. * @exception InvalidKeyException on invalid key encodings. */ @@ -236,7 +236,7 @@ public class X509Key implements PublicKey { /** * Encode SubjectPublicKeyInfo sequence on the DER output stream. - * + * * @exception IOException on encoding errors. */ public final void encode(DerOutputStream out) throws IOException { @@ -271,7 +271,7 @@ public class X509Key implements PublicKey { /** * Returns the DER-encoded form of the key as a byte array. - * + * * @exception InvalidKeyException on encoding errors. */ public byte[] encode() throws InvalidKeyException { @@ -310,16 +310,16 @@ public class X509Key implements PublicKey { * sequence consisting of an algorithm ID and a bit string which holds * the key. (That bit string is often used to encapsulate another DER * encoded sequence.) - * + * * <P> * Subclasses should not normally redefine this method; they should instead provide a <code>parseKeyBits</code> * method to parse any fields inside the <code>key</code> member. - * + * * <P> * The exception to this rule is that since private keys need not be encoded using the X.509 * <code>SubjectPublicKeyInfo</code> format, private keys may override this method, <code>encode</code>, and of * course <code>getFormat</code>. - * + * * @param in an input stream with a DER-encoded X.509 * SubjectPublicKeyInfo value * @exception InvalidKeyException on parsing errors. @@ -436,7 +436,7 @@ public class X509Key implements PublicKey { } /* - * parsePublicKey returns a PublicKey for use with package JSS from within netscape.security.*. + * parsePublicKey returns a PublicKey for use with package JSS from within netscape.security.*. * This function provide an interim solution for migrating from using the netscape.security.* package * to using the JSS package. */ @@ -461,23 +461,23 @@ public class X509Key implements PublicKey { return subjectKey; } - /* buildPublicKey returns a PublicKey for use with the JSS package from within netscape.security.*. + /* buildPublicKey returns a PublicKey for use with the JSS package from within netscape.security.*. * This function provide an interim solution for migrating from using the netscape.security.* package * to using the JSS package. */ static PublicKey buildPublicKey(AlgorithmId algid, byte[] key) throws IOException, InvalidKeyException { - /* - * Use the algid and key parameters to produce the ASN.1 encoding - * of the key, which will then be used as the input to the - * key factory. + /* + * Use the algid and key parameters to produce the ASN.1 encoding + * of the key, which will then be used as the input to the + * key factory. */ DerOutputStream x509EncodedKeyStream = new DerOutputStream(); encode(x509EncodedKeyStream, algid, key); X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(x509EncodedKeyStream.toByteArray()); try { - // Instantiate the key factory of the appropriate algorithm + // Instantiate the key factory of the appropriate algorithm KeyFactory keyFac = null; if (Security.getProvider("Mozilla-JSS") == null) { keyFac = KeyFactory.getInstance(algid.getName()); @@ -486,16 +486,16 @@ public class X509Key implements PublicKey { "Mozilla-JSS"); } - // Generate the public key + // Generate the public key PublicKey pubKey = keyFac.generatePublic(x509KeySpec); - /* - * Return specialized X509Key, where the structure within the - * key has been parsed + /* + * Return specialized X509Key, where the structure within the + * key has been parsed */ return pubKey; } catch (NoSuchAlgorithmException e) { - // Return generic X509Key with opaque key data (see below) + // Return generic X509Key with opaque key data (see below) throw new InvalidKeyException(e.toString()); } catch (InvalidKeySpecException e) { throw new InvalidKeyException(e.toString()); |