diff options
| author | Raif S. Naffah <raif@swiftdsl.com.au> | 2006-02-07 12:06:48 +0000 |
|---|---|---|
| committer | Raif S. Naffah <raif@swiftdsl.com.au> | 2006-02-07 12:06:48 +0000 |
| commit | a0aa28616cee4d202b7603ade0059cc7193fce3a (patch) | |
| tree | 7dce14555730876dcc818d79aa65e1faad762e63 /gnu/java/security/der/DERWriter.java | |
| parent | d01ec2b120ea555e66712accd965d544566bed2a (diff) | |
| download | classpath-a0aa28616cee4d202b7603ade0059cc7193fce3a.tar.gz | |
2006-02-07 Raif S. Naffah <raif@swiftdsl.com.au>
* gnu/java/security/key/KeyPairCodecFactory.java (getEncodingName): New
method.
(getEncodingShortName): Likewise.
* gnu/java/security/key/IKeyPairCodec.java (X509_FORMAT): New constant.
(PKCS8_FORMAT): Likewise.
(ASN1_FORMAT): Likewise.
* gnu/java/security/key/dss/DSSPublicKey.java (DSSPublicKey(4)): Call
constructor with 5 arguments.
(DSSPublicKey(5)): New constructor.
(valueOf): Handle ASN.1 encoding.
(getEncoded): Likewise.
* gnu/java/security/key/dss/DSSPrivateKey.java (DSSPrivateKey(4)): Call
constructor with 5 arguments.
(DSSPrivateKey(5)): New constructor.
(valueOf): Handle ASN.1 encoding.
(getEncoded): Likewise.
* gnu/java/security/key/dss/DSSKeyPairX509Codec.java: New file.
* gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java: Likewise.
* gnu/java/security/key/dss/DSSKeyPairGenerator.java
(PREFERRED_ENCODING_FORMAT): New constant.
(DEFAULT_ENCODING_FORMAT): Likewise.
(preferredFormat): New field.
(setup): Handle preferred format ID.
(generate): Use new ctors with 5 arguments.
* gnu/java/security/key/dss/DSSKey.java (DSSKey): Now accepts a format
ID as an additional argument.
(defaultFormat): new field.
(getFormat): Returns the preferred format as a short string.
* gnu/java/security/jce/sig/DSSKeyFactory.java: New file.
* gnu/java/security/jce/sig/EncodedKeyFactory.java (engineGetKeySpec):
Likewise
* gnu/java/security/jce/sig/DSSKeyPairGeneratorSpi.java
(initialize(AlgorithmParameterSpec)): Set ASN.1 as the preferred
encoding format.
(initialize(int,boolean,SecureRandom)): Likewise.
* gnu/java/security/der/DERWriter.java (writeBitString): Use
writeLength() instead of write().
return buf.length + 1 instead of buf.length.
Diffstat (limited to 'gnu/java/security/der/DERWriter.java')
| -rw-r--r-- | gnu/java/security/der/DERWriter.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gnu/java/security/der/DERWriter.java b/gnu/java/security/der/DERWriter.java index 4298151e0..0c2633605 100644 --- a/gnu/java/security/der/DERWriter.java +++ b/gnu/java/security/der/DERWriter.java @@ -222,10 +222,10 @@ public class DERWriter implements DER throws IOException { byte[] buf = bs.getShiftedByteArray(); - out.write(buf.length + 1); + writeLength(out, buf.length + 1); out.write(bs.getIgnoredBits()); out.write(buf); - return buf.length; + return buf.length + 1; } private static int writeString(OutputStream out, int tag, String str) |
