Bu, dökümanın eski bir sürümüdür!
This section provides brief explanations for the signature types that are frequently used. You should read the document “E-Signature Profiles” before deciding on which signature type is proper for you. See the document TS ETSI 101 733 for detailed information about signature types.
BES is the simplest type of signature guarantees only the identity of the signer. Since the signing time can not be detected, the signature can only be verified until the signer certificate expires. After the certificate expires, the signature can not be verified. Although BES signature can include signing time information as a signed attribute that attribute has no legal validity.
BaseSignedData bs = new BaseSignedData(); bs.addContent(new SignableByteArray("test".getBytes())); //Since SigningTime attribute is optional,add it to optional attributes list List<IAttribute> optionalAttributes = new ArrayList<IAttribute>(); optionalAttributes.add(new SigningTimeAttr(Calendar.getInstance())); HashMap<String, Object> params = new HashMap<String, Object>(); params.put(EParameters.P_CERT_VALIDATION_POLICY, VALIDATION_POLICY); bs.addSigner(ESignatureType.TYPE_BES, cert, signer, optionalAttributes, params);
BaseSignedData bs = new BaseSignedData(); bs.addContent(new SignableByteArray(Encoding.ASCII.GetBytes("test"))); //Since SigningTime attribute is optional,add it to optional attributes list List<IAttribute> optionalAttributes = new List<IAttribute>(); optionalAttributes.Add(new SigningTimeAttr(DateTime.UtcNow)); Dictionary<String, Object> params_ = new Dictionary<String, Object>(); params_[EParameters.P_CERT_VALIDATION_POLICY] = VALIDATION_POLICY; bs.addSigner(ESignatureType.TYPE_BES, cert, signer, optionalAttributes, params_);
To access the signing time in the signed attribute the sample code here can be used. The signing time stated by the signer can not be used because he may not have stated the correct time. For example the user certificate may be revoked by the user stated a time before the revocation time in the signature. Therefore the signing time attribute in BES has no legal validity.
EST signatures can be created from BES by adding a timestamp showingt the signing time. When creating the signatures timestamp settings must be specified. The sample code below shows how to create EST signature.
BaseSignedData bs = new BaseSignedData(); bs.addContent(new SignableByteArray("test".getBytes())); HashMap<String, Object> params = new HashMap<String, Object>(); //ilerli for getting signaturetimestamp TSSettings tsSettings = new TSSettings("http://zd.ug.net", 21, "12345678".toCharArray(),DigestAlg.SHA1); params.put(EParameters.P_TSS_INFO, tsSettings); params.put(EParameters.P_CERT_VALIDATION_POLICY, TestConstants.getPolicy()); //add signer bs.addSigner(ESignatureType.TYPE_EST, cert, signer, null, params);
BaseSignedData bs = new BaseSignedData(); bs.addContent(new SignableByteArray(Encoding.ASCII.GetBytes("test"))); Dictionary<String, Object> params_ = new Dictionary<String, Object>(); //ilerli for getting signaturetimestamp TSSettings tsSettings = new TSSettings("http://zd.ug.net", 21, "12345678",,DigestAlg.SHA1); params_[EParameters.P_TSS_INFO] = tsSettings; params_[EParameters.P_CERT_VALIDATION_POLICY] = TestConstants.getPolicy(); //add signer bs.addSigner(ESignatureType.TYPE_EST, cert, signer, null, params_);
Since the signing time can be determined by the timestamp, verification of EST signatures is possible even after the signing certificate expires. To get the signing time the code here can be used.
An ESXLong signature is also an EST signature. As addition to EST, ESXLong signature also includes the certificate validation data to be used during signature verification. Because of that, when creating an EXLong signature first the signing certificate must be validated and the validation data created and this data must be included in the signature. Thus, the signature can be verified after the certificate expires even if the validation data is not accessible outside. The sama sample code as the one for EST creation can be used for ESXLong creation just by changing the signature type.
ESA imza tipi kriptografik algoritmaların zamanla güvenilirliğini kaybetmesine karşı geliştirilmiş bir imza türüdür. Şu anda güvenerek kullandığımız algoritmalar, 5-10 yıl sonra güvenilemez olabilir. Bu algoritmalar güvenilmez duruma geçmeden önce, imzaların ESA tipine çevrilmesi gerekmektedir. Fakat imza atıldıktan hemen sonra imzanın ESA'ya çevrilmesi fazladan bir güvenlik sağlamaz. Algoritmaların bir kısmı güvenilmez duruma geçerken, daha güvenilir yeni algoritmalar kullanılmaya başlanacaktır. ESA tipine çevrim sırasında bu yeni algoritmalar kullanılmalıdır.
ESA'yı kullanmanın bir diğer amacı da imza üzerinde değişiklik yapılmasını engellemek olabilir. Eğer seri imza kullanılıyorsa; ESA'ya çevrilen imzanın altındaki imzaların veri yapısında bir değişiklik yapılamaz. Bu değişiklikler imza türünün değiştirilmesi, imzanın silinmesi veya yeni imza eklenmesi olabilir.
Bir imza atılırken ESA tipinde atılamaz. Öncelikle başka bir tipte atılmalı, daha sonra ESA tipine çevrilmelidir. ESA tipine dönüşüm sırasında arşiv tipi zaman damgası kullanılmaktadır. Bundan dolayı parametreler yardımıyla zaman damgası ayarları verilmelidir.
byte [] signatureFile = AsnIO.dosyadanOKU(TestConstants.getDirectory() + "testdata/ESXLong-1.p7s"); BaseSignedData bs = new BaseSignedData(signatureFile); Map<String,Object>parameters = new HashMap<String, Object>(); //Archive time stamp is added to signature, so time stamp settings are needed. parameters.put(EParameters.P_TSS_INFO, TestConstants.getTSSettings()); parameters.put(EParameters.P_CERT_VALIDATION_POLICY, TestConstants.getPolicy()); bs.getSignerList().get(0).convert(ESignatureType.TYPE_ESA, parameters); AsnIO.dosyayaz(bs.getEncoded(), TestConstants.getDirectory()+"testdata/ESA-2.p7s");
byte[] content = AsnIO.dosyadanOKU(TestConstants.getDirectory() + "testdata\\ ESXLong-1.p7s"); BaseSignedData bs = new BaseSignedData(content); Dictionary<String, Object> parameters = new Dictionary<String, Object>(); //Archive time stamp is added to signature, so time stamp settings are needed. parameters[EParameters.P_TSS_INFO] = TestConstants.getTSSettings(); parameters[EParameters.P_CERT_VALIDATION_POLICY] = TestConstants.getPolicy(); bs.getSignerList()[0].convert(ESignatureType.TYPE_ESA, parameters); AsnIO.dosyayaz(bs.getEncoded(), TestConstants.getDirectory() + "testdata\\ESA-2.p7s");