такой метод не нашел
Код: keyStore.getCertificateChain()
есть такой
Код:Certificate[] java.security.KeyStore.getCertificateChain(String alias)
на флэшке два алиаса, в каждом по одному сертификату, не соображу что брать?
Код:String alias = "ххххххххх@2012-10-19-ООО «ххх»";
String alias2 = "ххххххххх@2011-10-18-ООО «ххх»";
keyStore = KeyStore.getInstance("RutokenStore");
keyStore.load(null, null);
Certificate[] cer = keyStore.getCertificateChain(alias);
System.out.println(cer.length);
вот что примерно в сертификате
[
[
Version: V3
Subject: SURNAME=....
Signature Algorithm: 1.2.643.2.2.3, OID = 1.2.643.2.2.3
Key: ru.CryptoPro.JCP.Key.GostPublicKey
Validity: [From: Fri Oct 19 17:10:00 MSK 2012,
To: Tue Nov 19 17:11:00 MSK 2013]
Issuer: CN=UC Sertum-Pro, O=ООО Сертум-Про, L=Екатеринбург, C=RU, EMAILADDRESS=ca@sertum-pro.ru
SerialNumber: [ 57e82f58 00000000 b225]
Certificate Extensions: 9
[1]: ObjectId: 1.3.6.1.5.5.7.1.1 Criticality=false
AuthorityInfoAccess [
[
accessMethod: 1.3.6.1.5.5.7.48.2
accessLocation: URIName:
http://ca.sertum-pro.ru/...tes/sertum-pro-2011.crt, accessMethod: 1.3.6.1.5.5.7.48.2
accessLocation: URIName:
http://ca.sertum.ru/cert...ates/sertum-pro-2011.crt]
]
[2]: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
RFC822Name:
natav63@yandex.ru]
[3]: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 07 D0 64 10 C1 36 6F 30 51 2C 08 A6 A5 79 FB 47 ..d..6o0Q,...y.G
0010: 3D 9A 51 DE =.Q.
]
]
[4]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 24 DD 5A 0F 90 B1 5F C8 F6 64 E3 9C FA 06 17 DD $.Z..._..d......
0010: 06 DD B2 6A ...j
]
]
[5]: ObjectId: 1.2.643.2.2.49.2 Criticality=false
Extension unknown: DER encoded OCTET string =
0000: 04 76 30 74 30 64 16 32 68 74 74 70 3A 2F 2F 73 .v0t0d.2http://s
0010: 65 72 74 75 6D 2E 72 75 2F 61 62 6F 75 74 2F 64 ertum.ru/about/d
0020: 6F 63 75 6D 65 6E 74 73 2F 63 72 79 70 74 6F 70 ocuments/cryptop
0030: 72 6F 2D 6C 69 63 65 6E 73 65 0C 2A D0 A1 D0 9A ro-license.*....
0040: D0 91 20 D0 9A D0 BE D0 BD D1 82 D1 83 D1 80 20 .. ............
0050: D0 B8 20 D0 A1 D0 B5 D1 80 D1 82 D1 83 D0 BC 2D .. ............-
0060: D0 9F D1 80 D0 BE 03 02 05 E0 04 0C 2E 05 DB 62 ...............b
0070: D3 E3 D3 89 29 76 B0 09 ....)v..
[6]: ObjectId: 2.5.29.16 Criticality=false
PrivateKeyUsage: [
From: Fri Oct 19 17:10:00 MSK 2012, To: Tue Nov 19 17:10:00 MSK 2013]
[7]: ObjectId: 2.5.29.37 Criticality=false
ExtendedKeyUsages [
clientAuth
emailProtection
1.2.643.2.2.34.6
1.2.643.3.185.1
1.2.643.6.3.1.1
1.2.643.3.7.5.70
1.2.643.6.3.1.3.1
1.2.643.6.3.1.2.1
1.2.643.6.3.1.4.1
1.2.643.6.3.1.4.2
1.2.643.6.3.1.4.3
1.2.643.3.7.0.1.13
]
[8]: ObjectId: 2.5.29.31 Criticality=false
CRLDistributionPoints [
[DistributionPoint:
[URIName:
http://ca.sertum-pro.ru/cdp/sertum-pro-2011.crl]
, DistributionPoint:
[URIName:
http://ca.sertum.ru/cdp/sertum-pro-2011.crl]
]]
[9]: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
DigitalSignature
Non_repudiation
Key_Encipherment
Data_Encipherment
]
]
Algorithm: [1.2.643.2.2.3]
Signature:
0000: AE 68 2E 3D A4 68 5A E0 EA E3 0C 9F 7C 2D 76 21 .h.=.hZ......-v!
0010: 28 7F CD A8 87 86 43 7E 2E 5F 13 B0 0B DF DE 66 (.....C.._.....f
0020: AF 32 39 9C 84 AB 3C 80 41 3A 21 42 6F 82 12 C0 .29...<.A:!Bo...
0030: 46 DD 3D 15 C0 1A 36 B7 C8 F4 B1 04 9E 88 2A 20 F.=...6.......*
]