Package org.jmrtd.lds

Class PACEInfo

    • Field Detail

      • PARAM_ID_GFP_1024_160

        public static final int PARAM_ID_GFP_1024_160
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_GFP_2048_224

        public static final int PARAM_ID_GFP_2048_224
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_GFP_2048_256

        public static final int PARAM_ID_GFP_2048_256
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_NIST_P192_R1

        public static final int PARAM_ID_ECP_NIST_P192_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_BRAINPOOL_P192_R1

        public static final int PARAM_ID_ECP_BRAINPOOL_P192_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_NIST_P224_R1

        public static final int PARAM_ID_ECP_NIST_P224_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_BRAINPOOL_P224_R1

        public static final int PARAM_ID_ECP_BRAINPOOL_P224_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_NIST_P256_R1

        public static final int PARAM_ID_ECP_NIST_P256_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_BRAINPOOL_P256_R1

        public static final int PARAM_ID_ECP_BRAINPOOL_P256_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_BRAINPOOL_P320_R1

        public static final int PARAM_ID_ECP_BRAINPOOL_P320_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_NIST_P384_R1

        public static final int PARAM_ID_ECP_NIST_P384_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_BRAINPOOL_P384_R1

        public static final int PARAM_ID_ECP_BRAINPOOL_P384_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_BRAINPOOL_P512_R1

        public static final int PARAM_ID_ECP_BRAINPOOL_P512_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
      • PARAM_ID_ECP_NIST_P521_R1

        public static final int PARAM_ID_ECP_NIST_P521_R1
        Standardized domain parameters. Based on Table 6.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PACEInfo

        public PACEInfo​(String oid,
                        int version,
                        int parameterId)
        Constructs a PACE info object.
        Parameters:
        oid - the object identifier, indicating what PACE variant is to be used (agreement protocol, mapping type, and secure channel properties)
        version - a version number, which should be 2
        parameterId - either a standardized domain parameter id from table 6 or a proprietary domain parameter
      • PACEInfo

        public PACEInfo​(String oid,
                        int version,
                        BigInteger parameterId)
        Creates a PACE info object.
        Parameters:
        oid - the object identifier, indicating what PACE variant is to be used (agreement protocol, mapping type, and secure channel properties)
        version - a version number, which should be 2
        parameterId - either a standardized domain parameter id from table 6 or a proprietary domain parameter
    • Method Detail

      • createPACEInfo

        public static PACEInfo createPACEInfo​(byte[] paceInfoBytes)
        Creates a PACE info from an encoding.
        Parameters:
        paceInfoBytes - the encoded bytes
        Returns:
        a PACE info object
      • getObjectIdentifier

        public String getObjectIdentifier()
        Returns the PACE protocol object identifier.
        Specified by:
        getObjectIdentifier in class SecurityInfo
        Returns:
        the PACE protocol object identifier
      • getProtocolOIDString

        public String getProtocolOIDString()
        Returns the protocol object identifier as a human readable string.
        Specified by:
        getProtocolOIDString in class SecurityInfo
        Returns:
        a string describing the PACE protocol object identifier
      • getVersion

        public int getVersion()
        Returns the version.
        Returns:
        the version
      • getParameterId

        public BigInteger getParameterId()
        Returns the parameter identifier.
        Returns:
        the parameter identifier
      • getDERObject

        @Deprecated
        public ASN1Primitive getDERObject()
        Deprecated.
        this method will be removed from visible interface (because of dependency on BC API)
        Returns a DER object with this SecurityInfo data (DER sequence).
        Specified by:
        getDERObject in class SecurityInfo
        Returns:
        a DER object with this SecurityInfo data
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • checkRequiredIdentifier

        public static boolean checkRequiredIdentifier​(String oid)
        Checks whether the object identifier is valid for describing a PACE protocol.
        Parameters:
        oid - a PACE object identifier
        Returns:
        a boolean indicating whether the object identifier describes a known PACE protocol
      • toMappingType

        public static PACEInfo.MappingType toMappingType​(String oid)
        Returns the mapping type for a given PACE protocol object identifier.
        Parameters:
        oid - a PACE protocol object identifier
        Returns:
        the mapping type
      • toKeyAgreementAlgorithm

        public static String toKeyAgreementAlgorithm​(String oid)
        Returns the key agreement algorithm ("DH" or "ECDH") for a PACE protocol object identifier.
        Parameters:
        oid - a PACE protocol object identifier
        Returns:
        a key agreement algorithm as JCE mnemonic string
      • toCipherAlgorithm

        public static String toCipherAlgorithm​(String oid)
        Returns the encryption algorithm described in the PACE protocol object identifier.
        Parameters:
        oid - the PACE protocol object identifier
        Returns:
        a encryption algorithm as JCE mnemonic string
      • toDigestAlgorithm

        public static String toDigestAlgorithm​(String oid)
        Returns the digest algorithm described in the PACE protocol object identifier.
        Parameters:
        oid - the PACE protocol object identifier
        Returns:
        a digest algorithm as JCE mnemonic string
      • toKeyLength

        public static int toKeyLength​(String oid)
        Returns the key length (128, 192, or 256) described in the given PACE protocol object identifier.
        Parameters:
        oid - a PACE protocol object identifier
        Returns:
        the key length in bits
      • toParameterSpec

        public static AlgorithmParameterSpec toParameterSpec​(BigInteger stdDomainParam)
        Derives a JCE algorithm parameter specification from a PACE standard domain parameter integer.
        Parameters:
        stdDomainParam - the standard domain parameter
        Returns:
        a JCE algorithm parameter specification
      • toParameterSpec

        public static AlgorithmParameterSpec toParameterSpec​(int stdDomainParam)
        Derives a JCE algorithm parameter specification from a PACE standard domain parameter integer.
        Parameters:
        stdDomainParam - the standard domain parameter
        Returns:
        a JCE algorithm parameter specification
      • toStandardizedParamIdString

        public static String toStandardizedParamIdString​(BigInteger stdDomainParam)
        Derives a human readable algorithm description from a PACE standard domain parameter integer.
        Parameters:
        stdDomainParam - the standard domain parameter
        Returns:
        a human readable algorithm description