diff options
author | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
commit | 171aaece4f23709d33d180cf36eb3af5e454b0c9 (patch) | |
tree | 1485f9f0a7bd10de4ff25030db575dbb8dafae74 /pki/base/util/src/com/netscape/cmsutil/ocsp/NameID.java | |
parent | adad2fcee8a29fdb82376fbce07dedb11fccc182 (diff) | |
download | pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.gz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.xz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.zip |
Revert "Formatting"
This reverts commit 32150d3ee32f8ac27118af7c792794b538c78a2f.
Diffstat (limited to 'pki/base/util/src/com/netscape/cmsutil/ocsp/NameID.java')
-rw-r--r-- | pki/base/util/src/com/netscape/cmsutil/ocsp/NameID.java | 138 |
1 files changed, 75 insertions, 63 deletions
diff --git a/pki/base/util/src/com/netscape/cmsutil/ocsp/NameID.java b/pki/base/util/src/com/netscape/cmsutil/ocsp/NameID.java index 016c058d7..aa6ef1b55 100644 --- a/pki/base/util/src/com/netscape/cmsutil/ocsp/NameID.java +++ b/pki/base/util/src/com/netscape/cmsutil/ocsp/NameID.java @@ -30,76 +30,88 @@ import org.mozilla.jss.pkix.primitive.Name; /** * RFC 2560: - * + * * <pre> * ResponderID ::= CHOICE { * byName [1] EXPLICIT Name, * byKey [2] EXPLICIT KeyHash } * </pre> - * + * * @version $Revision$ $Date$ */ -public class NameID implements ResponderID { - private Name _name = null; - private static final Tag TAG = SEQUENCE.TAG; - - public NameID(Name n) { - _name = n; - } - - public Tag getTag() { - return Tag.get(1); - } - - public void encode(Tag tag, OutputStream os) throws IOException { - _name.encode(os); - } - - public void encode(OutputStream os) throws IOException { - _name.encode(os); - } - - public Name getName() { - return _name; - } - - private static final Template templateInstance = new Template(); - - public static Template getTemplate() { - return templateInstance; - } - - /** - * A Template for decoding <code>ResponseBytes</code>. - */ - public static class Template implements ASN1Template { - - private SEQUENCE.Template seqt; - - public Template() { - seqt = new SEQUENCE.Template(); - // seqt.addElement(new EXPLICIT.Template( - // new Tag (1), new Name.Template()) ); - seqt.addElement(new Name.Template()); - - } - - public boolean tagMatch(Tag tag) { - return TAG.equals(tag); +public class NameID implements ResponderID +{ + private Name _name = null; + private static final Tag TAG = SEQUENCE.TAG; + + public NameID(Name n) + { + _name = n; + } + + public Tag getTag() + { + return Tag.get(1); + } + + public void encode(Tag tag, OutputStream os) throws IOException + { + _name.encode(os); + } + + public void encode(OutputStream os) throws IOException + { + _name.encode(os); + } + + public Name getName() + { + return _name; + } + + private static final Template templateInstance = new Template(); + + public static Template getTemplate() { + return templateInstance; } - public ASN1Value decode(InputStream istream) - throws InvalidBERException, IOException { - return decode(TAG, istream); - } - - public ASN1Value decode(Tag implicitTag, InputStream istream) - throws InvalidBERException, IOException { - SEQUENCE seq = (SEQUENCE) seqt.decode(implicitTag, istream); - - // EXPLICIT e_name = (EXPLICIT) seq.elementAt(0); - Name name = (Name) seq.elementAt(0); - return new NameID(name); - } - } + /** + * A Template for decoding <code>ResponseBytes</code>. + */ + public static class Template implements ASN1Template + { + + private SEQUENCE.Template seqt; + + public Template() + { + seqt = new SEQUENCE.Template(); + // seqt.addElement(new EXPLICIT.Template( + // new Tag (1), new Name.Template()) ); + seqt.addElement(new Name.Template()); + + } + + public boolean tagMatch(Tag tag) + { + return TAG.equals(tag); + } + + public ASN1Value decode(InputStream istream) + throws InvalidBERException, IOException + { + return decode(TAG, istream); + } + + public ASN1Value decode(Tag implicitTag, InputStream istream) + throws InvalidBERException, IOException + { + SEQUENCE seq = (SEQUENCE) seqt.decode(implicitTag, + istream); + + // EXPLICIT e_name = (EXPLICIT) seq.elementAt(0); + Name name = (Name)seq.elementAt(0); + return new NameID(name); + } + } } |