Bu, dökümanın eski bir sürümüdür!
The certificate validation policy file coming the downloaded api, provides standard controls for a certificate to be considered as valid. It uses only the certificates store as the source of trusted certificates. The certificate store contains legally valid root certificates. Therefore, in order to work with test certificates you have to define the root of the test certificates as trusted in the certificate validation policy file. You can see section Configuring The Policy at Run-time.
You can also specify the method of revocation control, via either OCSP or CRL. Validation of a certificate requires validation of the all certificates on the certificate chain. Not all of the certificates on the chain is available for OCSP query. So it is not possible to validate a certificate using only OCSP queries. By configuring the validation policy properly, validation operation first tries OCSP and if it is not available then tries CRL control for the certificate revocation check. In this case, the method that must be performed first must be placed before the other in the policy file.
The policy file can be edited after read from the file system. For example, the code below, demonstrates how to add TrustedCertificateFinderFromFileSystem to the validation policy at run-time.
ValidationPolicy POLICY = PolicyReader.readValidationPolicy(new FileInputStream(POLICY_FILE)); //For UEKAE Test Environment, we add our test roots. HashMap<String, Object> parameters = new HashMap<String, Object>(); parameters.put("dizin", "T:\\MA3\\api-cmssignature\\testdata\\support\\UGRootCerts\\"); POLICY.bulmaPolitikasiAl().addTrustedCertificateFinder("tr.gov.tubitak.uekae.esya.api.certificate.validation.find.certificate.trusted.TrustedCertificateFinderFromFileSystem", parameters);
ValidationPolicy POLICY = PolicyReader.readValidationPolicy(POLICY_FILE); //For UEKAE Test Environment, we add our test roots. Dictionary<String, Object> parameters = new Dictionary<String, Object>(); parameters.Add("dizin", "T:\\MA3\\api-cmssignature\\testdata\\support\\UGRootCerts\\"); POLICY.bulmaPolitikasiAl().addTrustedCertificateFinder("tr.gov.tubitak.uekae.esya.api.certificate.validation.find.certificate.trusted.TrustedCertificateFinderFromFileSystem", parameters);
The classes that can be included in the policy file are listed in the table below. In this table, the character “*” in the section where possible values for a paramater are listed denotes the default value. The symbol [O] denotes that the parameter is optional. The XML tags next to each header shows the place where the classes under that header should be in the policy file.
TRUSTED CERTIFICATE CHECKERS <policy><validate><certificate><trustedcertificate> |
|||
---|---|---|---|
CertificateDateChecker | Validates that the validity period in the certificate covers the validation time. | ||
SelfSignatureChecker | Validates that the signature in the certificate is created by the public key in the certificate. | ||
CERTIFICATE SELF CHECKERS <policy><validate><certificate><self> |
|||
CertificateDateChecker | Validates that the validity period in the certificate covers the validation time. | ||
CertificateExtensionChecker | Validates that the extension information in the certificate is compatible with RFC 5280. | ||
PositiveSerialNumberChecker | Validates that the certificate serial number is positive integer. | ||
SignatureAlgConsistencyChecker | Validates thet the signature algorithms in the certificate are matching. | ||
VersionChecker | Validates that the version information in the certificate is compatible with RFC 5280. | ||
QualifiedCertificateChecker | Validates that the certificate has qualified certificate properties. | ||
Parameters | statementoids | Given oids is required in the certificate. In some cases multiple oids are required. You can combine multiple oids with AND or OR relation. Different oids are used in differnet countries. In such cases, oids are combined with OR relation. ( i.e. ”(0.4.0.1862.1.1 AND 2.16.792.1.61.0.1.5070.1.1) OR (4.3.2.1 AND 1.2.3.4)”) | |
CERTIFICATE CHAIN CHECKERS <policy><validate><certificate><issuer> |
|||
BasicConstraintCAChecker | Validates that the basic constraints extension in the issuer certificate is compatible with RFC 5280. | ||
CertificateKeyUsageChecker | Validates that the key usage extension in the issuer certificate is compatible with RFC 5280. | ||
CertificateNameChecker | Validates that the issuer information in the certificate is matching with the subject information in the issuer certificate. | ||
CertificateSignatureChecker | Validates that the signature in the certificate is created by the issuer certificate by cryptographic verification. | ||
KeyIdentifierChecker | Validates that the authority key identifier extension in the certificate is matching with the subject key identifier extension in the issuer certificate. | ||
NameConstraintsChecker | Validates that the relation between subject information in the certificate and the name constraints extension in the issuer certificate is compatible with RFC 5280. | ||
PathLenConstraintChecker | Validates that the path length constraints extension in the issuer certificate is compatible with RFC 5280. | ||
PolicyConstraintsChecker | Validates that the policy constraints extension in the issuer certificate is compatible with RFC 5280. | ||
CERTIFICATE REVOCATION CHECKERS <policy><validate><certificate><revocation> |
|||
RevocationFromCRLChecker | Performs revocation control of a certificate by looking at the corresponding CRL. | ||
Parameters | cevrimdisicalis | [true,false*] Indicates that the validation is performed offline. When specified as True, revocation checker return successful result iven if it can not find any crl. This parameter is defined in order to validate certificates in offline environments where online crls are not available. Must be used with care! |
|
checkAllCRLs | [true,false*] Normally, it is enough to check one valid CRL for the revocation control of a certificate from a crl. In some cases, user may want to check all crls that can be found by the finders. If so, this parameter must be set to true. |
||
devam | [true,false*] If it is true, then the validation process continues to the next crl even if the control for the current crl completed successfully. |
||
RevocationFromOCSPChecker | |||
Parameters | devam | [true,false*] If it is true, then the validation process continues to the next ocsp response even if the control for the current ocsp response completed successfully. |
|
CRL SELF CHECKERS <policy><validate><crl><crlself> |
|||
CRLDateChecker | Validates that the validity period in the crl covers the validation time. | ||
CRLExtensionChecker | Validates that the extension information in the crl is compatible with RFC 5280. | ||
CRL CHAIN CHECKERS <policy><validate><crl><crlissuer> |
|||
CRLKeyUsageChecker | Validates that the key usage extension in the issuer crl certificate is compatible with RFC 5280. | ||
CRLSignatureChecker | Validates that the signature in the crl is created by the crl issuer certificate by cryptographic verification. | ||
DELTA CRL CHECKERS <policy><validate><deltacrl> |
|||
FreshestCRLChecker | Validates that the freshest crl extension in the delta crl is compatible with RFC 5280. | ||
DeltaCRLIndicatorChecker | Validates that the delta crl indicator extension in the delta crl is compatible with RFC 5280. | ||
OCSP RESPONSE CHECKERS <policy><validate><ocsp> |
|||
SigningCertificateChecker | Validates the ocsp response signing certificate. | ||
OCSPSignatureChecker | Validates that the signature in the ocsp response is created by the oscp issuer certificate by cryptographic verification. | ||
ResponseStatusChecker | Validates that the response status information in the ocsp response is valid. | ||
OCSPResponseDateChecker | Validates that the validity period in the ocsp response covers the validation time. |
CERTIFICATE MATCHERS <policy><match><certificate> |
|
---|---|
IssuerSubjectMatcher | Sertifika üzerindeki yayıncı özne adı (issuer) alanı ile yayıncı sertifikası üzerindeki özne adı (subject ) alanlarını eşleştirir. |
CRL MATCHERS <policy><match><certificate> |
|
CRLDistributionPointMatcher | Sertifika üzerindeki SİL Dağıtım Noktaları (CRLDistributionPoints) eklentisinin üzerindeki bilgi ile SİL üzerindeki (varsa) Yayıncı Dağıtım Noktası (IssuingDistributionPoint) eklentisine bakarak SİL ile sertifikayı eşleştirir. |
CRLDistributionPointOnlyContainsMatcher | SİL üzerindeki Yayıncı Dağıtım Noktası (Issuing Distribution Point) eklentisindeki onlyContains özellikleri ile Sertifika üzerindeki Temel Kısıtlamalar (BasicConstraint) eklentisine bakarak SİL ile sertifikayı eşleştirir |
CRLIssuerMatcher | SİL üzerindeki yayıncı adı (issuer) alanı ile Sertifika üzerindeki yayıncı adı (issuer) alanına bakarak SİL ile sertifikayı eşleştirir. |
CRLKeyIDMatcher | SİL üzerindeki Yetkili Anahtar Tanımlayıcısı (AuthorityKeyIdentifier) eklentisi ile Sertifika üzerindeki Yetkili Anahtar Tanımlayıcısı (AuthorityKeyIdentifier) eklentisine bakarak SİL ile sertifikayı eşleştirir. |
Delta CRL MATCHERS<policy><match><certificate> |
|
BaseCRLNumberMatcher | Delta SİL üzerindeki Temel SİL Numarası (BaseCRLNumber) eklentisi ile temel SİL üzerindeki SİL Numarası (CRLNumber) eklentisine bakarak temel SİL ile delta SİL'i eşleştirir. |
CRLNumberMatcher | Delta SİL üzerindeki SİL Numarası (CRLNumber) eklentisi üzerindeki SİL numarasının temel SİL üzerindeki SİL Numarası (CRLNumber) eklentisi üzerindeki SİL Numarasından büyük olduğunu doğrulayarak temel SİL ile delta SİL'i eşleştirir. |
DeltaCRLIssuerMatcher | Delta SİL üzerindeki yayıncı adı (issuer) alanı ile temel SİL üzerindeki yayıncı adı (issuer) alanına bakarak temel SİL ile delta SİL'i eşleştirir. |
ScopeMatcher | Delta SİL üzerindeki Yayıncı Dağıtım Noktası (IssuingDistributionPoint) eklentisi ile temel SİL üzerindeki Yayıncı Dağıtım Noktası (IssuingDistributionPoint) eklentisine bakarak temel SİL ile delta SİL'i eşleştirir. |
OCSP CEVABI EŞLEŞTİRİCİLER <policy><match><ocsp> |
|
CertIDOCSPResponseMatcher | OCSP cevabı üzerindeki Sertifika Tanımlayıcısı (CertID) alanına bakarak sertifika ile OCSP cevabını eşleştirir. |
ÇAPRAZ SERTİFİKA EŞLEŞTİRİCİLER <policy><match><crosscertificate> |
|
PublicKeyMatcher | Yayıncı sertifikasındaki açık anahtar ile Çapraz sertifika üzerindeki açık anahtarı eşleştirir. |
SKIMatcher | Yayıncı sertifikasındaki Özne Anahtar Tanımlayıcısı(SubjectKeyIdentifier) ile Çapraz sertifika üzerindeki Özne Anahtar Tanımlayıcısını(SubjectKeyIdentifier) eşleştirir. |
SubjectMatcher | Yayıncı sertifikasındaki özne adı (subject) alanı ile Çapraz sertifika üzerindeki özne adı (subject) alanını eşleştirir. |
TRUSTED CERTFICATE FINDERS<policy> <find><trustedcertificate> |
|||
---|---|---|---|
TrustedCertificateFinderFromECertStore | Yerel sertifika deposundaki yayıncı sertifikalarını getirir ve bu sertifikaları güvenilir kabul eder. | ||
Parameters | securitylevel | [PERSONAL*, ORGANIZATIONAL, LEGAL] Depodan getirilecek sertifikaların güven seviyesini belirler. Kişisel sertifikalar için PERSONAL, kurumsal sertifikalar için ORGANIZATIONAL, kanuni sertifikalar için LEGAL olarak belirtilmelidir. |
|
storepath [O] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. | ||
TrustedCertificateFinderFromFileSystem | Dosya sisteminde verilen dizin adresindeki yayıncı sertifikalarını getirir. Bu sertifikaları güvenilir kabul eder. | ||
Parameters | dizin | Dizin adresi | |
TrustedCertificateFinderFromXml | Verilen URL adresindeki yayıncı sertifikalarını getirir. Bu sertifikaları güvenilir kabul eder. | ||
Parameters | storepath [O] | URL adresi | |
CERTIFICATE FINDERS <policy><find><certificate> |
|||
CertificateFinderFromECertStore | Yerel sertifika deposundaki sertifikaları getirir. | ||
Parameters | storepath [0] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. | |
CertificateFinderFromFile | Dosya sisteminde verilen dosya adresindeki sertifikaları getirir. | ||
Parameters | dosyayolu | Dosya adresi | |
CertificateFinderFromXml | Verilen URL adresindeki sertifikalarını getirir. | ||
Parameters | storepath [O] | URL adresi | |
CertificateFinderFromHTTP | Sertifika üzerinde yer alan Yetkili Erişim Bilgileri (AuthorityInfoAccess) eklentisindeki HTTP adresinden yayıncı sertifikasını getirir. | ||
CertificateFinderFromLDAP | Sertifika üzerinde yer alan Yetkili Erişim Bilgileri (AuthorityInfoAccess) eklentisindeki LDAP adresinden yayıncı sertifikasını getirir. | ||
CRL FINDERS <policy><validate><certificate><revocation><find> |
|||
CRLFinderFromECertStore | Yerel sertifika deposundaki SİL'leri getirir. | ||
Parameters | storepath [0] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. | |
getactivecrl | [true,false*] Sertifika doğrulamanın kesin bir şekilde yapılması için sertifika doğrulamanın yapıldığı tarihten sonra yayınlanan SİL kullanılmaktadır. Yalnız yeni yayınlanacak SİL beklenmek istenmeyebilir ve yayında olan SİL kullanılmak istenebilir. Bu durumda getactivecrl parametresi için true verilmelidir. |
||
CRLFinderFromFile | Dosya sisteminde verilen dosya adresindeki SİL'leri getirir. | ||
Parameters | dosyayolu | Dosya adresi | |
CRLFinderFromHTTP | Sertifika üzerinde yeralan SİL Dağıtım Noktaları(CRLDistributionPoints) eklentisindeki HTTP adresinden SİL'i getirir. | ||
CRLFinderFromLDAP | Sertifika üzerinde yeralan SİL Dağıtım Noktaları(CRLDistributionPoints) eklentisindeki LDAP adresinden yayıncı sertifikasını getirir. | ||
OCSP RESPONSE FINDERS <policy><validate><certificate><revocation><find> |
|||
OCSPResponseFinderFromECertStore | Yerel sertifika deposundaki kayıtlı OCSP Cevaplarını getirir. | ||
Parameters | storepath [0] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. | |
OCSPResponseFinderFromAIA | Sertifika üzerinde yeralan Yetkili Erişim Bilgileri (AuthorityInfoAccess) eklentisindeki OCSP adresine OCSP sorgusu yaparak OCSP cevabı getirir. | ||
DELTA CRL FINDERS <find><deltacrl> |
|||
DeltaCRLFinderFromECertStore | Yerel sertifika deposundaki Delta SİL'leri getirir. | ||
Parameters | storepath [0] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. | |
DeltaCRLFinderFromFile | Dosya sisteminde verilen dosya adresindeki Delta SİL'leri getirir. | ||
Parameters | dosyayolu | Dosya adresi | |
CROSS CERTIFICATE FINDERS <find><crosscertificate> |
|||
CrossCertificateFinderFromECertStore | Yerel sertifika deposundaki çapraz sertifikaları getirir. | ||
Parameters | storepath [0] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. | |
CrossCertificateFinderFromFile | Dosya sisteminde verilen dosya adresindeki çapraz sertifikaları getirir. | ||
Parameters | dosyayolu | File address |
SAVERS<policy><save> |
|||
---|---|---|---|
CertStoreCertificateSaver | Sertifika doğrulama sırasında bulunan ve doğrulanan sertifikaları yerel sertifika deposuna kaydeder. | ||
Parameters | storepath [O] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. | |
CertStoreCRLSaver | Sertifika doğrulama sırasında uzaktan(LDAP, http vb.) bulunan SİL'leri yerel sertifika deposuna kaydeder. | ||
Parameters | storepath [O] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. | |
CertStoreOCSPResponseSaver | Sertifika doğrulama sırasında uzaktan(LDAP, http vb.) bulunan OCSP'leri yerel sertifika deposuna kaydeder. | ||
Parameters | storepath [O] | Yerel sertifika deposunun dosya sistemindeki yerini belirler. |