Bu sayfanın seçili sürümü ile mevcut sürümü arasındaki farkları gösterir.
en:esya:cades:imza-dogrulama [2013/09/02 11:25] Dindar Öz |
en:esya:cades:imza-dogrulama [2013/09/02 13:16] (mevcut) Dindar Öz |
||
---|---|---|---|
Satır 44: | Satır 44: | ||
==== Signature Validation Result ==== | ==== Signature Validation Result ==== | ||
- | ''SignedDataValidation'' sınıfının ''verify(...)'' fonksiyonu doğrulama sonucu olarak ''SignatureValidationResult'' tipinde bir nesne döner. ''getSDStatus()'' fonksiyonu, eğer bütün imzalar doğrulanmış ise ''ALL_VALID'', eğer imzalardan en az bir tanesi doğrulanamamışsa ''NOT_ALL_VALID'' döner. ''SignedDataValidation'' nesnesinin ''toString()'' metodu, bütün imzalar için kontrol sonucu açıklamalarını döner. Eğer özellikle bir imzanın sonucu elde edilmek isteniyorsa, bu sonuç imza ağacında gezerek elde edilebilir. Bu ağaç yapısı, BaseSignedData yapısındaki imzaların veri yapısı ile aynıdır. Örneğin birinci paralel imzanın, birinci seri imzasına ve bu imzanın doğrulama sonucuna aşağıdaki örnek kod ile ulaşılabilir. | + | "verify" returns an object of the class ''SignatureValidationResult''. The method ''getSDStatus()'' of this class takes the value ''ALL_VALID'' if all of the signatures in the document are verified successfully, and ''NOT_ALL_VALID'' if any fails. By using ''toString()'' you can get control results as textual explanations. |
+ | The validation result of a specific signature is accessed by traversing in the validation result tree. The following code demonstrates accessing the validation result of the first counter signature of the first parallel signature. | ||
<sxh java;title:Java> | <sxh java;title:Java> | ||
Satır 64: | Satır 65: | ||
</sxh> | </sxh> | ||
- | Her imzanın doğrulama sonucu ''SignatureValidationResult'' nesnelerinde tutulur. Bir imzacının doğrulama sonucundan, seri imzacılarının doğrulama sonuçlarına da erişilebilir. ''SignatureValidationResult'' nesnelerinin ''toString()'' fonksiyonu, imzacının ve seri imzacıların doğrulama kontrolcülerinin sonuçlarını döner. Eğer sadece o imzaya ait kontrolcülerin açıklamaları elde edilmek isteniyorsa ''getValidationDetails()'' fonksiyonunu kullanılmalıdır. İmza tipi geliştikçe, kontrol edilmesi gereken yapı ve sertifika sayısı artmaktadır. Zaman damgaları, imza yapısına bir imza olarak eklendiklerinden ayrıca bir imza olarak kontrol edilmektedirler. | + | The validation result of each signature is stored in ''SignatureValidationResult'' objects. A validation result of a signature also contains the validation results of its counter signatures. The methof ''toString()'' of an object of the class ''SignatureValidationResult'' returns textual validation results of the signature and its counter signatures. If only the validation details of the signature is wanted, not those of its counter signatures, then the method ''getValidationDetails()'' must be used. As the signature type gets more advanced, the number of control operations and certificates increase. Since timestamps are also added to the signature as another signed data, they should also be verified. |
- | ''SignatureValidationResult'' nesnesinden bir imzanın doğrulama sonucu ''getSignatureStatus()'' fonksiyonu ile ''Signature_Status'' yapısında alınabilir. Eğer imza sonucu ''INCOMPLETE'' ise sertifika doğrulama verisine ulaşılamamıştır. | + | The method ''getSignatureStatus()'' of the class ''SignatureValidationResult'' returns the signature status as an object of the class ''Signature_Status''. If the result ''INCOMPLETE'' means the certificate validation data could not be reached. |
- | ==== Ön Doğrulama ==== | + | ==== PRE-VALIDATION ==== |
- | Bir imzanın doğrulanması için, imza atıldıktan sonra sertifika iptal bilgilerinin güncellenebilmesi için belirli bir süre geçmesi gerekmektedir. Bu süreye "kesinleşme süresi"(grace period) denilmektedir. API'de bu süre ''P_GRACE_PERIOD'' parametresi ile ayarlanabilir; varsayılan değeri 86400 saniye yani 24 saattir. | + | For the complete verification of a signature , a certain time after the signature creation has to pass in order for the certificate revocation information to be updated. This period is called "grace period". In the API, this period can be specified by the parameter ''P_GRACE_PERIOD'' and it is 86400 seconds (1 day) by default. |
- | Bir imza doğrulanmaya çalışıldığında, kesinleşme süresi bitmemiş olsa bile imza ve sertifika doğrulanabilmektedir. Öndoğrulama denilen bu doğrulama bir kesinlik içermemektedir. Kesin bir doğrulama yapılabilmesi için kesinleşme süresinin geçmesi gerekmektedir. Bir imzanın doğrulanmasının ön doğrulama olduğunu aşağıdaki örnek kod ile öğrenebilirsiniz. Ön doğrulama için olgunlaşmamış anlamına gelen "PREMATURE" kelimesi, kesinleşmiş imza için olgunlaşmış anlamına gelen "MATURE" kelimesi kullanılmaktadır. | + | Sometimes, signature verification is performed before the grace period passes, which is called pre-validation and does not provide an absolute validation information. For an absolute result, the grace period must be wait. |
- | + | In that sense, the result of the pre-validation is indicated by ''premature'' whereas the absolute validation result is indicated by ''MATURE'' in the API. The code below, shows how to get the status of a signature validation result. | |
- | ''SignatureValidationResult'' nesnesinin ''getValidationState()'' fonksiyonu ile ön doğrulama yapılıp yapılmadığı bilgisi alınabilir. | + | |
<sxh java;title:Java> | <sxh java;title:Java> | ||
Satır 89: | Satır 89: | ||
</sxh> | </sxh> | ||
- | Ön doğrulama ile kesin doğrulama arasında doğabilecek fark; ön doğrulama sırasında geçerli olan bir sertifikanın, kesin doğrulamada iptal edilmiş olabilmesidir. Kullanıcı akıllı kartını çaldırdığında bu senaryo ile karşılaşılabilir. | + | In rare cases, the result of pre-validation is different from the result of complete validation. This may happen when the signing certificate was valid during pre-validation but revoked at the time of complete validation. Revocation of a certificate due to the stolen smartcard of a user may cause this. |
- | + | ||
- | ÇiSDuP için kesinleşme süresi kısa olabilmektedir. Yalnız iptal bilgileri için SİL kullanılıyorsa bu süre uzayabilmektedir. | + | |
- | "E-İmza Profilleri" dökümanı ÇiSDuP kullanıldığında kesinleşme süresinin çok kısa olduğundan yok sayılabileceğini öngörüyor. ÇiSDuP kullanarak sertifika doğrulama yapıldığında, kesinleşme süresi için beklenmediğinden büyük avantaj sağlanmaktadır. | + | The grace period is pretty short for OCSP Responses while CRL requires a longer grace period. |
+ | The document "E-Signature Profiles" states that tie grace period for OCSP is negligable and can be ignored. Therefore using OCSP provides great advantage since it does not require any grace period to be wait for. | ||
- | ==== Ayrık İmzanın Doğrulanması ==== | + | ==== Verification of Detached Signature ==== |
- | Ayrık imza doğrulanırken, imzalanan dökümanının parametre olarak verilmesi gerekmektedir.Bunun için ''P_EXTERNAL_CONTENT'' parametresine ISignable türünden nesne verilmelidir. | + | When a detached signature is verified, the content must be provided by the parameter ''P_EXTERNAL_CONTENT''. |
<sxh java;title:Java> | <sxh java;title:Java> |