Bu sayfanın seçili sürümü ile mevcut sürümü arasındaki farkları gösterir.
en:esya:smartcard:sertifika-okuma [2013/09/12 06:34] Dindar Öz oluşturuldu |
en:esya:smartcard:sertifika-okuma [2013/09/12 06:55] (mevcut) Dindar Öz |
||
---|---|---|---|
Satır 1: | Satır 1: | ||
===== Reading Certificates ===== | ===== Reading Certificates ===== | ||
- | Akıllı karttan sertifika ''SmartCard'' sınıfının ''getSignatureCertificates()'' veya ''getEncryptionCertificates()'' fonksiyonları ile okunabilir. Eğer imzalama işlemi yapılacaksa ''getSignatureCertificates()'' fonksiyonu, şifreleme işlemi yapılacaksa ''getEncryptionCertificates()'' fonksiyonu kullanılmalıdır.Bu fonksiyonlar sertifikaların kodlanmış hallerini byte [] olarak dönerler. Eğer ESYA API-ASN modülünü (ma3api-asn-....jar / ma3api-asn.dll) kullanabiliyorsanız, karttan aldığınız byte değerlerini anlamlı hale getirmek için ''ECertificate'' sınıfını kullanabilirsiniz. | + | To read certificates from a smartcard the methods ''getSignatureCertificates()'' or ''getEncryptionCertificates()'' of ''SmartCard'' can be used. For signature creation ''getSignatureCertificates()'' and for encryption ''getEncryptionCertificates()'' must be used. |
+ | These methods returns certificates in binary encoded format. If you are using (ma3api-asn-....jar / ma3api-asn.dll) then you can use ''ECertificate'' to convert this binary value to a meaningful certificate object. | ||
- | Atılacak imzanın kanuni yükümlülüklerinin olması için imzalamada kullanılan sertifikanın nitelikli olması gerekmektedir. Bu kontrol ''ECertificate'' sınıfının ''isQualifiedCertificate()'' fonksiyonu ile yapılabilir. | + | The signing certificate must be a qualified certificate in order for the signature to have legal validity. |
- | ''ECertificate'' sınıfının ''getSubject().stringValue()'' fonksiyonu ile sertifikalar birbirinden ayırt edilebilir. Kullanıcı bu bilgi ile seçim yapabilir. | + | The method ''isQualifiedCertificate()'' of ''ECertificate'' checks if a certificate is qualified. |
+ | Certificates can be differentiated from each pther by their subject values which can be retrieved by ''getSubject().stringValue()'' in ''ECertificate''. User may select a specific certificate according to the subject value. | ||
- | Ayrıca ''ECertificate'' sınıfının ''getSubject().getCommonNameAttribute()'' fonksiyonu, sertifika sahibinin ismini dönmektedir. Karttaki sertifikaların isim bilgisi, tüm sertifikalar için aynı olacağından, karttaki sertifikaları ayırt etmek amacıyla kullanılamaz. İmzayı kimin attığını göstermek için kullanılabilir. | + | Besides, the method ''getSubject().getCommonNameAttribute()'' of ''ECertificate'' returns the name of the certificate owner. In a smartcard, since all of the certificates have the same owner, this method can not be used to differentiate the certificates in a smartcard. It can be used to display the name of the signer. |
- | Aşağıdaki kod bloğu akıllı kart içinden imzalama sertifikalarını alır ve nitelikli olanların subject alanını ekrana yazar. | + | The code segment below demonstrates reading signing certificates from a smartcard and shows the subject fields of the qualified ones. |
<sxh java;title:Java> | <sxh java;title:Java> | ||
Satır 30: | Satır 32: | ||
</sxh> | </sxh> | ||
- | Eğer ESYA API-ASN sınıflarına erişim yoksa, ''ECertificate'' yerine java'nın ''x509Certificate'' sınıfı kullanılabilir. ''ECertificate'' sınıfının ''isQualifiedCertificate()'' fonksiyonu yerine aşağıdaki örnek kodda gösterildiği gibi kontrol yapılabilir. Sertifikaları birbirinden ayırt etmek amacıyla ''x509Certificate'' sınıfının ''getSubjectDN().toString()'' metodu kullanılabilir. | + | If ESYA API-ASN classes are not available, the class ''x509Certificate'' can be used instaed of ''ECertificate''. Instead of using ''isQualifiedCertificate()'', the sample code can be used in this case. |
+ | To retrieve the subject field of a certificate the method ''getSubjectDN().toString()'' of ''x509Certificate'' can be used. | ||
- | Aşağıdaki kod bloğu akıllı kart içinden imzalama sertifikalarını alır ve nitelikli olanların Subject alanını ekrana yazar. | + | The code segment below demonstrates reading signing certificates from a smartcard and shows the subject fields of the qualified ones. |
<sxh java;title:Java> | <sxh java;title:Java> | ||
Satır 47: | Satır 50: | ||
</sxh> | </sxh> | ||
- | ==== Akıllı Karttaki Nesne Adlarının Okunması ==== | + | ==== Reading Names of the Objects in Smartcard ==== |
- | Akıllı kartta bulunan sertifika, açık anahtar ve özel anahtarın her biri nesne olarak adlandırılır. Akıllı karttaki nesnelerin adı ile de işlem yapılabilir. Nesne adları değişken olabileceğinden nesne adları ile işlem yapmak önerilmez. Yalnız bazı durumlarda nesne adları kullanıcıya daha anlamlı gelebilir. | + | Each certificate ,public key and private key take place as objects in a smartcard. Smartcard operations can also be performed by using the name of the objects in it which is not suggested since those names may change from card to card. In some cases using object names may be more meaningful to the user. The methods ''getSignatureKeyLabels(...)'' and ''getEncryptionKeyLabels(...)'' of ''SmartCard'' are used to read the names of the keys. I the name of the certificate object is the same as the name of the keys then the certificate can also be read with this name for which ''readCertificate(long aSessionID,String aLabel)'' can be used. |
- | ''SmartCard'' sınıfının ''getSignatureKeyLabels(...)'' ve ''getEncryptionKeyLabels(...)'' fonksiyonları ile anahtarların adları okunabilir. Eğer anahtarın, sertifikasının adı anahtarla aynı ise bu ad ile sertifika da okunabilir. Sertifikanın okunması için ''readCertificate(long aSessionID,String aLabel)'' fonksiyonu kullanılabilir. | + | |