diff options
author | mcentner <mcentner@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2007-08-08 07:25:32 +0000 |
---|---|---|
committer | mcentner <mcentner@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2007-08-08 07:25:32 +0000 |
commit | 43e57a42832ea8b4ceb0317f3c9028a4174ffa7b (patch) | |
tree | f5ed9074b8d7b89b2dd5b22d326f63be103e7551 /spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java | |
parent | 10889e9dea2cc2f70b475e6ff7af37fdba1621d9 (diff) | |
download | moa-id-spss-43e57a42832ea8b4ceb0317f3c9028a4174ffa7b.tar.gz moa-id-spss-43e57a42832ea8b4ceb0317f3c9028a4174ffa7b.tar.bz2 moa-id-spss-43e57a42832ea8b4ceb0317f3c9028a4174ffa7b.zip |
Adapted project directory structure to suit the new maven based build process.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@909 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java')
-rw-r--r-- | spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java deleted file mode 100644 index 0814c90d6..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java +++ /dev/null @@ -1,125 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -import java.math.BigInteger; -import java.security.Principal; - -import iaik.asn1.structures.Name; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; - -/** - * A class containing the issuer and serial number of a certificate, which can - * be used to uniquely identify the certificate. - * - * The issuer is contained as an RFC2253 encoded <code>String</code>. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IssuerAndSerial { - - /** The issuer distinguished name. */ - private String issuerDN; - /** The certificate serial number. */ - private BigInteger serial; - - /** - * Create an <code>IssuerAndSerial</code> object. - * - * The name of the issuer is converted to RFC2253. If it cannot be parsed, the - * DN contained in the <code>issuer</code> is set. - * - * @param issuer The isser of a certificate. - * @param serial The serial number of the certificate. - */ - public IssuerAndSerial(Principal issuer, BigInteger serial) { - String issuerDN = null; - if (issuer instanceof Name) { - try { - issuerDN = ((Name)issuer).getRFC2253String(); - } catch (RFC2253NameParserException e) { - // do nothing - } - } - if (issuerDN == null) { - RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); - try { - issuerDN = ((Name)parser.parse()).getRFC2253String(); - } catch (RFC2253NameParserException e) { - issuerDN = issuer.getName(); - } - } - this.serial = serial; - this.issuerDN = issuerDN; - } - - /** - * Create an <code>IssuerAndSerial</code> object. - * - * @param issuerDN The issuer distinguished name. Should be an RFC2253 name. - * @param serial The serial number of the certificate. - */ - public IssuerAndSerial(String issuerDN, BigInteger serial) { - this.issuerDN = issuerDN; - this.serial = serial; - } - - /** - * Return the issuer DN in RFC2253 format. - * - * @return The issuer part of this object. - */ - public String getIssuerDN() { - return issuerDN; - } - - /** - * Return the serial number. - * - * @return The serial number of this object. - */ - public BigInteger getSerial() { - return serial; - } - - /** - * Compare this <code>IssuerAndSerial</code> to another object. - * - * @param other The object to compare this <code>IssuerAndSerial</code> to. - * @return <code>true</code>, if <code>other</code> is an - * <code>IssuerAndSerial</code> object and the <code>issuer</code> and - * <code>serial</code> fields are both equal. <code>false</code> otherwise. - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - if (other instanceof IssuerAndSerial) { - IssuerAndSerial ias = (IssuerAndSerial) other; - return getIssuerDN().equals(ias.getIssuerDN()) - && getSerial().equals(ias.getSerial()); - } - return false; - } - - /** - * Return the hash code of this <code>IssuerAndSerial</code>. - * - * @return The hash code of this <code>IssuerAndSerial</code>. - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return issuerDN.hashCode() ^ serial.hashCode(); - } - - /** - * Return a <code>String</code> representation of this - * <code>IssuerAndSerial</code> object. - * - * @return The <code>String</code> representation. - * @see java.lang.Object#toString() - */ - public String toString() { - return ("(IssuerAndSerial - Issuer<" + getIssuerDN()) - + ("> Serial<" + serial.toString() + ">)"); - } - -} |