Class AbstractX500NameStyle

  • All Implemented Interfaces:
    io.anyline.nfc.bouncycastle.asn1.x500.X500NameStyle

    
    public abstract class AbstractX500NameStyle
     implements X500NameStyle
                        

    This class provides some default behavior and common implementation for a X500NameStyle. It should be easily extendable to support implementing the desired X500NameStyle.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static Hashtable copyHashTable(Hashtable paramsMap) Tool function to shallow copy a Hashtable.
      int calculateHashCode(X500Name name) Calculate a hashCode for the passed in name.
      ASN1Encodable stringToValue(ASN1ObjectIdentifier oid, String value) For all string values starting with '#' is assumed, that these are already valid ASN.1 objects encoded in hex.
      boolean areEqual(X500Name name1, X500Name name2) Return true if the two names are equal.
      • Methods inherited from class io.anyline.nfc.bouncycastle.asn1.x500.X500NameStyle

        attrNameToOID, fromString, oidToAttrNames, oidToDisplayName, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractX500NameStyle

        AbstractX500NameStyle()
    • Method Detail

      • copyHashTable

         static Hashtable copyHashTable(Hashtable paramsMap)

        Tool function to shallow copy a Hashtable.

        Parameters:
        paramsMap - table to copy
        Returns:

        the copy of the table

      • calculateHashCode

         int calculateHashCode(X500Name name)

        Calculate a hashCode for the passed in name.

        Parameters:
        name - the name the hashCode is required for.
        Returns:

        the calculated hashCode.

      • stringToValue

         ASN1Encodable stringToValue(ASN1ObjectIdentifier oid, String value)

        For all string values starting with '#' is assumed, that these are already valid ASN.1 objects encoded in hex.

        All other string values are send to encodeStringValue.

        Subclasses should overwrite encodeStringValue to change the encoding of specific types.
        Parameters:
        oid - the DN name of the value.
        value - the String representation of the value.
      • areEqual

         boolean areEqual(X500Name name1, X500Name name2)

        Return true if the two names are equal.

        Parameters:
        name1 - first name for comparison.
        name2 - second name for comparison.
        Returns:

        true if name1 = name 2, false otherwise.