Package org.jmrtd.lds
Class PACEInfo
- java.lang.Object
-
- org.jmrtd.lds.AbstractLDSInfo
-
- org.jmrtd.lds.SecurityInfo
-
- org.jmrtd.lds.PACEInfo
-
- All Implemented Interfaces:
Serializable
,LDSElement
public class PACEInfo extends SecurityInfo
PACE Info object as per SAC TR 1.01, November 11, 2010.- Since:
- 0.5.0
- Version:
- $Revision: 1805 $
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PACEInfo.DHCParameterSpec
A DH parameter specification which also keeps track of the prime order of the subgroup generated by the generator.static class
PACEInfo.MappingType
Generic mapping and Integrated mapping and CAM mapping.
-
Field Summary
Fields Modifier and Type Field Description static int
PARAM_ID_ECP_BRAINPOOL_P192_R1
Standardized domain parameters.static int
PARAM_ID_ECP_BRAINPOOL_P224_R1
Standardized domain parameters.static int
PARAM_ID_ECP_BRAINPOOL_P256_R1
Standardized domain parameters.static int
PARAM_ID_ECP_BRAINPOOL_P320_R1
Standardized domain parameters.static int
PARAM_ID_ECP_BRAINPOOL_P384_R1
Standardized domain parameters.static int
PARAM_ID_ECP_BRAINPOOL_P512_R1
Standardized domain parameters.static int
PARAM_ID_ECP_NIST_P192_R1
Standardized domain parameters.static int
PARAM_ID_ECP_NIST_P224_R1
Standardized domain parameters.static int
PARAM_ID_ECP_NIST_P256_R1
Standardized domain parameters.static int
PARAM_ID_ECP_NIST_P384_R1
Standardized domain parameters.static int
PARAM_ID_ECP_NIST_P521_R1
Standardized domain parameters.static int
PARAM_ID_GFP_1024_160
Standardized domain parameters.static int
PARAM_ID_GFP_2048_224
Standardized domain parameters.static int
PARAM_ID_GFP_2048_256
Standardized domain parameters.-
Fields inherited from class org.jmrtd.lds.SecurityInfo
ID_AA, ID_CA_DH_3DES_CBC_CBC, ID_CA_DH_AES_CBC_CMAC_128, ID_CA_DH_AES_CBC_CMAC_192, ID_CA_DH_AES_CBC_CMAC_256, ID_CA_ECDH_3DES_CBC_CBC, ID_CA_ECDH_AES_CBC_CMAC_128, ID_CA_ECDH_AES_CBC_CMAC_192, ID_CA_ECDH_AES_CBC_CMAC_256, ID_EC_PUBLIC_KEY, ID_EC_PUBLIC_KEY_TYPE, ID_PACE, ID_PACE_DH_GM, ID_PACE_DH_GM_3DES_CBC_CBC, ID_PACE_DH_GM_AES_CBC_CMAC_128, ID_PACE_DH_GM_AES_CBC_CMAC_192, ID_PACE_DH_GM_AES_CBC_CMAC_256, ID_PACE_DH_IM, ID_PACE_DH_IM_3DES_CBC_CBC, ID_PACE_DH_IM_AES_CBC_CMAC_128, ID_PACE_DH_IM_AES_CBC_CMAC_192, ID_PACE_DH_IM_AES_CBC_CMAC_256, ID_PACE_ECDH_CAM, ID_PACE_ECDH_CAM_AES_CBC_CMAC_128, ID_PACE_ECDH_CAM_AES_CBC_CMAC_192, ID_PACE_ECDH_CAM_AES_CBC_CMAC_256, ID_PACE_ECDH_GM, ID_PACE_ECDH_GM_3DES_CBC_CBC, ID_PACE_ECDH_GM_AES_CBC_CMAC_128, ID_PACE_ECDH_GM_AES_CBC_CMAC_192, ID_PACE_ECDH_GM_AES_CBC_CMAC_256, ID_PACE_ECDH_IM, ID_PACE_ECDH_IM_3DES_CBC_CBC, ID_PACE_ECDH_IM_AES_CBC_CMAC_128, ID_PACE_ECDH_IM_AES_CBC_CMAC_192, ID_PACE_ECDH_IM_AES_CBC_CMAC_256, ID_PK_DH, ID_PK_ECDH, ID_TA, ID_TA_ECDSA, ID_TA_ECDSA_SHA_1, ID_TA_ECDSA_SHA_224, ID_TA_ECDSA_SHA_256, ID_TA_RSA, ID_TA_RSA_PSS_SHA_1, ID_TA_RSA_PSS_SHA_256, ID_TA_RSA_V1_5_SHA_1, ID_TA_RSA_V1_5_SHA_256
-
-
Constructor Summary
Constructors Constructor Description PACEInfo(String oid, int version, int parameterId)
Constructs a PACE info object.PACEInfo(String oid, int version, BigInteger parameterId)
Creates a PACE info object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
checkRequiredIdentifier(String oid)
Checks whether the object identifier is valid for describing a PACE protocol.static PACEInfo
createPACEInfo(byte[] paceInfoBytes)
Creates a PACE info from an encoding.boolean
equals(Object other)
ASN1Primitive
getDERObject()
Deprecated.this method will be removed from visible interface (because of dependency on BC API)String
getObjectIdentifier()
Returns the PACE protocol object identifier.BigInteger
getParameterId()
Returns the parameter identifier.String
getProtocolOIDString()
Returns the protocol object identifier as a human readable string.int
getVersion()
Returns the version.int
hashCode()
static String
toCipherAlgorithm(String oid)
Returns the encryption algorithm described in the PACE protocol object identifier.static String
toDigestAlgorithm(String oid)
Returns the digest algorithm described in the PACE protocol object identifier.static String
toKeyAgreementAlgorithm(String oid)
Returns the key agreement algorithm ("DH"
or"ECDH"
) for a PACE protocol object identifier.static int
toKeyLength(String oid)
Returns the key length (128, 192, or 256) described in the given PACE protocol object identifier.static PACEInfo.MappingType
toMappingType(String oid)
Returns the mapping type for a given PACE protocol object identifier.static AlgorithmParameterSpec
toParameterSpec(int stdDomainParam)
Derives a JCE algorithm parameter specification from a PACE standard domain parameter integer.static AlgorithmParameterSpec
toParameterSpec(BigInteger stdDomainParam)
Derives a JCE algorithm parameter specification from a PACE standard domain parameter integer.static String
toStandardizedParamIdString(BigInteger stdDomainParam)
Derives a human readable algorithm description from a PACE standard domain parameter integer.String
toString()
-
Methods inherited from class org.jmrtd.lds.AbstractLDSInfo
getEncoded
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from class org.jmrtd.lds.SecurityInfo
getInstance, writeObject
-
-
-
-
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 2parameterId
- 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 2parameterId
- 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 classSecurityInfo
- Returns:
- the PACE protocol object identifier
-
getProtocolOIDString
public String getProtocolOIDString()
Returns the protocol object identifier as a human readable string.- Specified by:
getProtocolOIDString
in classSecurityInfo
- 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 classSecurityInfo
- Returns:
- a DER object with this SecurityInfo data
-
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
-
-