public final class TSLValidatorMappingCalculator
extends java.lang.Object
This class offers static methods to extract mappings of a certificate validated through a TSL.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<java.lang.String> |
STATIC_MAPPING_NAMES_SET
Constant attribute that represents the set of mapping names that are static.
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.String> |
addMappingsAndCheckCertClassification(java.util.Map<java.lang.String,java.lang.String> certInfoMap,
java.util.Map<java.lang.String,java.lang.String> certInfoMapFromTSL)
Adds the mappings extracted from the TSL information (and certificate) over the mappings configured in the certificate policies.
|
static java.lang.String |
calculateMappingCertClassificationFromMappingClassification(java.lang.String classificationValue)
Calculates the mapping for the logic field 'certClassification' from the input mapping value
of the logic field 'clasificacion'.
|
static boolean |
checksIfMappingNameMatchesWithSomeStaticMappingName(java.lang.String mappingName)
Checks if the input mapping name matches with some of the static mapping names.
|
static void |
extractStaticMappingsFromResult(TSLCertificateExtensionAnalyzer tslCertExtAnalyzer,
java.util.Map<java.lang.String,java.lang.String> mappings,
ITSLValidatorResult tslValidationResult)
Extracts the static mappings from the validation result, and add these on the input mapping set.
|
static java.lang.String |
getMappingClassificationFromCertificate(TSLCertificateExtensionAnalyzer tslCertExtAnalyzer,
boolean translateMapping)
Tries to extract from the certificate its classification type.
|
static java.lang.String |
getMappingQSCDFromCertificate(TSLCertificateExtensionAnalyzer tslCertExtAnalyzer)
Tries to extract from the certificate if it has its private key in a QSCD.
|
static java.lang.String |
getMappingTypeQualifiedFromCertificate(TSLCertificateExtensionAnalyzer tslCertExtAnalyzer)
Tries to extract from the certificate if it is qualified or not.
|
public static final java.util.Set<java.lang.String> STATIC_MAPPING_NAMES_SET
public static boolean checksIfMappingNameMatchesWithSomeStaticMappingName(java.lang.String mappingName)
mappingName - Mapping name to check.true if the input mapping name matches with some of the static mapping names,
otherwise false.public static void extractStaticMappingsFromResult(TSLCertificateExtensionAnalyzer tslCertExtAnalyzer, java.util.Map<java.lang.String,java.lang.String> mappings, ITSLValidatorResult tslValidationResult)
tslCertExtAnalyzer - TSL Certificate Extension Analyzer needed to resolve the mappings of the certificate.mappings - Map in which adds the pairs tslValidationResult - TSL validation result from which get the static mapping information.public static java.lang.String getMappingTypeQualifiedFromCertificate(TSLCertificateExtensionAnalyzer tslCertExtAnalyzer) throws TSLValidationException
tslCertExtAnalyzer - TSL Certificate Extension Analyzer needed to resolve the mappings of the certificate.TSLValidationException - In case of some error parsing the input certificate with BC provider.public static java.lang.String getMappingClassificationFromCertificate(TSLCertificateExtensionAnalyzer tslCertExtAnalyzer, boolean translateMapping) throws TSLValidationException
tslCertExtAnalyzer - TSL Certificate Extension Analyzer needed to resolve the mappings of the certificate.translateMapping - Flag that if it is true, then the returned mapping values
ITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_NATURAL_PERSON and ITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_LEGALPERSON
are translated to ITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_ESEAL and
ITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_ESIG respectively.ITslMappingConstants.MAPPING_VALUE_UNKNOWNITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_NATURAL_PERSONITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_LEGALPERSONITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_ESEALITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_ESIGITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_WSAITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_TSATSLValidationException - In case of some error parsing the input certificate with BC provider.public static java.lang.String getMappingQSCDFromCertificate(TSLCertificateExtensionAnalyzer tslCertExtAnalyzer) throws TSLValidationException
tslCertExtAnalyzer - TSL Certificate Extension Analyzer needed to resolve the mappings of the certificate.TSLValidationException - In case of some error parsing the input certificate with BC provider.public static java.lang.String calculateMappingCertClassificationFromMappingClassification(java.lang.String classificationValue)
classificationValue - String representation of the mapping value of the logical field 'clasificacion'.ITslMappingConstants.MAPPING_VALUE_UNKNOWNITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_NATURAL_PERSONITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_LEGALPERSONITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_ESEALITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_ESIGITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_WSAITslMappingConstants.MAPPING_VALUE_CLASSIFICATION_TSApublic static java.util.Map<java.lang.String,java.lang.String> addMappingsAndCheckCertClassification(java.util.Map<java.lang.String,java.lang.String> certInfoMap,
java.util.Map<java.lang.String,java.lang.String> certInfoMapFromTSL)
ITslMappingConstants.MAPPING_KEY_CERT_CLASSIFICATION is with ITslMappingConstants.MAPPING_VALUE_UNKNOWN in TSL mappings, then is calculated
from the ITslMappingConstants.MAPPING_KEY_CERT_CLASIFICACION field from the original mappings.certInfoMap - Mappings calculated from the certificate policy configuration.certInfoMapFromTSL - Mappings calculated from the information in the TSL and the certificate.