diff options
author | Raif S. Naffah <raif@swiftdsl.com.au> | 2006-04-29 07:10:06 +0000 |
---|---|---|
committer | Raif S. Naffah <raif@swiftdsl.com.au> | 2006-04-29 07:10:06 +0000 |
commit | 2cec246cc449513639e7d4c31bc067198edde36c (patch) | |
tree | ece84e325797304b976b5574481432ef8e32b3d9 | |
parent | 37b4a4e2d0ad88e80da69614aa5b2d89aca0a1e1 (diff) | |
download | classpath-2cec246cc449513639e7d4c31bc067198edde36c.tar.gz |
2006-04-29 Raif S. Naffah <raif@swiftdsl.com.au>
* gnu/java/security/x509/X500DistinguishedName.java: Updated copyright.
(putComponent): Handle O and OU components.
(getDer): Use correct (it2) iterator.
(readAttributeValue): Read next character and break if end-of-stream.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gnu/java/security/x509/X500DistinguishedName.java | 14 |
2 files changed, 18 insertions, 3 deletions
@@ -1,5 +1,12 @@ 2006-04-29 Raif S. Naffah <raif@swiftdsl.com.au> + * gnu/java/security/x509/X500DistinguishedName.java: Updated copyright. + (putComponent): Handle O and OU components. + (getDer): Use correct (it2) iterator. + (readAttributeValue): Read next character and break if end-of-stream. + +2006-04-29 Raif S. Naffah <raif@swiftdsl.com.au> + * gnu/java/security/provider/Gnu.java (run): Add "RSA" as an alias to MD5withRSA. * gnu/java/security/key/rsa/RSAKeyPairX509Codec.java (encodePublicKey): diff --git a/gnu/java/security/x509/X500DistinguishedName.java b/gnu/java/security/x509/X500DistinguishedName.java index daf746f5d..02adad7d2 100644 --- a/gnu/java/security/x509/X500DistinguishedName.java +++ b/gnu/java/security/x509/X500DistinguishedName.java @@ -1,5 +1,5 @@ /* X500DistinguishedName.java -- X.500 distinguished name. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -61,7 +61,6 @@ import java.util.Set; public class X500DistinguishedName implements Principal { - // Constants and fields. // ------------------------------------------------------------------------- @@ -221,6 +220,10 @@ public class X500DistinguishedName implements Principal putComponent(DC, value); else if (name.equals("uid")) putComponent(UID, value); + else if (name.equals("o")) + putComponent(O, value); + else if (name.equals("ou")) + putComponent(OU, value); else putComponent(new OID(name), value); } @@ -328,16 +331,18 @@ public class X500DistinguishedName implements Principal { if (fixed && encoded != null) return (byte[]) encoded.clone(); + ArrayList name = new ArrayList(components.size()); for (Iterator it = components.iterator(); it.hasNext(); ) { Map m = (Map) it.next(); if (m.isEmpty()) continue; + Set rdn = new HashSet(); for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); ) { - Map.Entry e = (Map.Entry) it.next(); + Map.Entry e = (Map.Entry) it2.next(); ArrayList atav = new ArrayList(2); atav.add(new DERValue(DER.OBJECT_IDENTIFIER, e.getKey())); atav.add(new DERValue(DER.UTF8_STRING, e.getValue())); @@ -486,6 +491,9 @@ public class X500DistinguishedName implements Principal throw new EOFException(); default: buf.append((char) ch); + ch = in.read(); + if (ch == -1) + return buf.toString(); } } } |