Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a4061a

Browse files
author
Wolfgang Glas
committed
TokenInfo implementation with very basic test case.
1 parent3457bcf commit7a4061a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

‎pkcs15/src/main/java/org/opensc/pkcs15/asn1/basic/GeneralizedTimeHolderImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public GeneralizedTimeHolderImpl(DERGeneralizedTime generalizedTime) {
4545
* @param obj The ASN.1 object to parse.
4646
* @return A GeneralizedTimeHoledr instance.
4747
*/
48-
publicGeneralizedTimeHoldergetInstance(Objectobj) {
48+
publicstaticGeneralizedTimeHoldergetInstance(Objectobj) {
4949

5050
if (objinstanceofGeneralizedTimeHolder)
5151
return (GeneralizedTimeHolder)obj;

‎pkcs15/src/test/java/test/org/opensc/pkcs15/TestSoftwareToken.java‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
importorg.apache.commons.logging.Log;
1717
importorg.apache.commons.logging.LogFactory;
18+
importorg.bouncycastle.asn1.ASN1InputStream;
19+
importorg.bouncycastle.asn1.ASN1OutputStream;
1820
importorg.clazzes.util.io.IOUtil;
1921
importorg.opensc.pkcs15.AIDs;
2022
importorg.opensc.pkcs15.application.Application;
@@ -27,6 +29,7 @@
2729
importorg.opensc.pkcs15.asn1.PKCS15RSAPublicKey;
2830
importorg.opensc.pkcs15.asn1.attr.CertificateObject;
2931
importorg.opensc.pkcs15.asn1.attr.PublicKeyObject;
32+
importorg.opensc.pkcs15.asn1.basic.TokenInfo;
3033
importorg.opensc.pkcs15.asn1.proxy.ReferenceProxy;
3134
importorg.opensc.pkcs15.token.PathHelper;
3235
importorg.opensc.pkcs15.token.Token;
@@ -205,6 +208,17 @@ public void testPKCS15Objects() throws IOException, CertificateParsingException
205208
assertTrue(certificate.getSpecificCertificateAttributes().getCertificateObject()instanceofReferenceProxy);
206209
((ReferenceProxy<CertificateObject>)certificate.getSpecificCertificateAttributes().getCertificateObject()).updateEntity();
207210

211+
PathHelper.selectDF(token,app.getApplicationTemplate().getPath());
212+
213+
token.selectEF(0x5032);
214+
215+
ASN1InputStreamais =newASN1InputStream(token.readEFData());
216+
TokenInfotokenInfo =TokenInfo.getInstance(ais.readObject());
217+
218+
ASN1OutputStreamaos =newASN1OutputStream(token.writeEFData());
219+
aos.writeObject(tokenInfo);
220+
aos.close();
221+
208222
this.checkEquality(this.tokenDir);
209223
}
210224

4 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp