|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.ac.Util
public class Util
This class contains various utility routines for converting things from one representation into another.
Field Summary | |
---|---|
static java.lang.String |
DATE_SEPARATOR
This is the separator between the dates. |
static java.lang.String |
SN_ATTRIBUTE_TYPE
This variable sets the attribute type for the serial number in the DN, when constructing it for the IssuerSerial case. |
static java.lang.String |
SN_NAME_SEPARATOR
This is the separator between the serial number and the DN of the Issuer. |
static java.lang.String |
TIME_SEPARATOR
This is the separator between the times. |
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static Generalized_Time |
buildGeneralizedTime(java.lang.String date)
Builds a date out of a string representation of it in date. |
static iaik.asn1.structures.GeneralNames |
buildGeneralNames(java.lang.String DN)
This method builds a General Names construct out of the string representation of an LDAP DN that should be RFC2253 compliant. |
static IssuerSerial |
buildIssuerSerial(java.lang.String what)
|
static java.lang.String |
generalNamesToString(iaik.asn1.structures.GeneralNames gns)
Converts the given general Name in iaik representation into a String. |
static byte[] |
hashDN(java.lang.String name)
This method converts the given string to a canonical DN, then calculates its hash using hashString. |
static byte[] |
hashName(GeneralNames gn)
This is a utility method that returns the hash of the DN contained in the GeneralNames. |
static byte[] |
hashString(java.lang.String s)
Returns MD5 hash of the given string. |
static java.lang.String |
hashToString(byte[] hash)
This method converts the hash byte array to string. |
static java.lang.String |
issuerSerialToDN(java.lang.String issuerDN,
java.math.BigInteger serialNumber)
This is the universal way for constructing the LDAP DN for the entry, whose name is constructed out of the PKC Issuer DN and PKC SN. |
static java.lang.String |
issuerToString(AttCertIssuer aci)
Returns the string representation of the Issuer General Name, if V1Form or IssuerName of the V2Form is present. |
static java.lang.String |
timeToString(java.util.Calendar date)
Converts the given date into internal format "ccyy.mm.dd hh:mm:ss". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SN_ATTRIBUTE_TYPE
public static java.lang.String TIME_SEPARATOR
public static java.lang.String SN_NAME_SEPARATOR
public static java.lang.String DATE_SEPARATOR
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static java.lang.String generalNamesToString(iaik.asn1.structures.GeneralNames gns)
gns
- the GeneralNames construct to convert; must be an X.500
directory name.
public static java.lang.String issuerSerialToDN(java.lang.String issuerDN, java.math.BigInteger serialNumber)
issuerDN
- - the DN of the issuerserialNumber
- - the serial number of the PKC issued by that issuer
public static java.lang.String issuerToString(AttCertIssuer aci)
aci
- - the AttCertIssuer structure
public static iaik.asn1.structures.GeneralNames buildGeneralNames(java.lang.String DN)
DN
- is the String with LDAP DN; if a parse error occures, a
GeneralNames
corresponding to the null DN will be constructed
public static java.lang.String hashToString(byte[] hash)
hash
- - the byte array of the hash
public static byte[] hashString(java.lang.String s)
s
- - the string of which the hash has to be calculated.
public static byte[] hashDN(java.lang.String name)
name
- - the DN to canonicalise and hash
public static byte[] hashName(GeneralNames gn)
gn
- - the GeneralNames of which the directoryName will be converted
to a canonical RFC2253-compliant LDAP distinguished name and then hashedpublic static Generalized_Time buildGeneralizedTime(java.lang.String date) throws ACCreationException
date
- the string representation of the date in form
"yyyy.mm.dd hh:mm:ss". The separators between numbers are defined by
DATE_SEPARATOR and TIME_SEPARATOR respectively, the space between
date and time is not redefinable. The lengths of numbers and ranges of
their values are not checked (unless Generalized_Time or GregorianCalendar
constructor does. More specific time values can be omitted. That is,
"yyyy" is a valid value, and "yyyy.mm", and "yyyy.mm.dd hh", etc; but "yyyy.mm hh" is not:
day must be specified first.
ACCreationException
- if the string representation does not comply with
the rules specified above.public static java.lang.String timeToString(java.util.Calendar date)
date
- the date to convert.
public static IssuerSerial buildIssuerSerial(java.lang.String what) throws ACCreationException
ACCreationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |