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

Commit0e1b114

Browse files
author
Wolfgang Glas
committed
Add more documentation to our basic interfaces.
1 parent2e932bb commit0e1b114

File tree

4 files changed

+78
-6
lines changed

4 files changed

+78
-6
lines changed

‎pkcs15/src/main/java/org/opensc/pkcs15/application/Application.java‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,30 @@
2626
importorg.opensc.pkcs15.token.Token;
2727

2828
/**
29-
* This interface describes a PKCS#15 application.
29+
* This interface describes a smart card application cf. to ISO7816.
30+
*
31+
* The functionality in this interface is very terse, because the scope of
32+
* applications may range from PKI application to specialized applications for
33+
* public health care.
3034
*
3135
* @author wglas
3236
*/
3337
publicinterfaceApplication {
3438

39+
/**
40+
* @return The application ID.
41+
*/
3542
byte[]getAID();
3643

44+
/**
45+
* @return The application template as stored inside the EF(DIR) object
46+
* in the root path of a token.
47+
*/
3748
publicISO7816ApplicationTemplategetApplicationTemplate();
3849

50+
/**
51+
* @return The token on which this application resides.
52+
*/
3953
publicTokengetToken();
4054

4155
}

‎pkcs15/src/main/java/org/opensc/pkcs15/application/impl/ApplicationFactoryImpl.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ protected Application constructApplication(Token token, ISO7816ApplicationTempla
7979
* @param token The token to which the new application will be bound.
8080
* @param aid The application ID.
8181
* @return The application object, if the application ID is recognized or null.
82+
* @throws IOException
8283
*/
83-
protectedApplicationconstructApplication(Tokentoken,byte[]aid)
84+
protectedApplicationconstructApplication(Tokentoken,byte[]aid)throwsIOException
8485
{
8586
if (Arrays.equals(AIDs.PKCS15_AID,aid))
8687
returnnewPKCS15Application(token);

‎pkcs15/src/main/java/org/opensc/pkcs15/application/impl/PKCS15Application.java‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@
3434
importorg.opensc.pkcs15.token.Token;
3535

3636
/**
37+
* A PKCS#15 application with PKI functionality.
38+
*
39+
* This class is the foundation for implementing a KeyStore and various key
40+
* classes of the JCE provider.
41+
*
3742
* @author wglas
38-
*
3943
*/
4044
publicclassPKCS15ApplicationimplementsApplication {
4145

@@ -46,9 +50,12 @@ public class PKCS15Application implements Application {
4650
privatestaticfinalbyte[]DEFAULT_PATH =newbyte[] {0x3F,0x00,0x50,0x15 };
4751

4852
/**
49-
* default constructor.
53+
* default constructor called during instantiation of a new application on the card.
54+
*
55+
* This constructor creates the basic DFs and EFs for the application for lateron
56+
* adding PKCS#15 objects to the directory.
5057
*/
51-
PKCS15Application(Tokentoken)
58+
PKCS15Application(Tokentoken)throwsIOException
5259
{
5360
this.token =token;
5461
this.template =newISO7816ApplicationTemplate();
@@ -58,7 +65,8 @@ public class PKCS15Application implements Application {
5865
}
5966

6067
/**
61-
* default constructor.
68+
* default constructor called during instantiation of an application already
69+
* existing on the card.
6270
* @throws IOException Upon errors reading additional token information.
6371
*/
6472
PKCS15Application(Tokentoken,ISO7816ApplicationTemplatetemplate)throwsIOException

‎pkcs15/src/main/java/org/opensc/pkcs15/token/Token.java‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,69 @@ public interface Token extends Closeable {
4444
*/
4545
voidreset()throwsIOException;
4646

47+
/**
48+
* @return The current file on the token.
49+
* @throws IOException Upon errors.
50+
*/
4751
TokenFilegetCurrentFile()throwsIOException;
4852

53+
/**
54+
* Select a file (DF or EF), which is a child of the current DF.
55+
*
56+
* @param path The relative path of the child to open.
57+
* @return The new current file on the token.
58+
* @throws IOException Upon errors.
59+
*/
4960
TokenFileselect(intpath)throwsIOException;
5061

62+
/**
63+
* Select the parent DF of the current DF.
64+
*
65+
* @return The parent DF, which is now the current file.
66+
* @throws IOException Upon errors.
67+
*/
5168
DFselectParentDF()throwsIOException;
5269

70+
/**
71+
* Select a DF, which is a child of the current DF.
72+
*
73+
* @param path The relative path of the DF to open.
74+
* @return The new current file on the token.
75+
* @throws IOException Upon card errors or when the selected file is not a DF.
76+
*/
5377
DFselectDF(intpath)throwsIOException;
5478

79+
/**
80+
* Select an EF, which is a child of the current DF.
81+
*
82+
* @param path The relative path of the EF to open.
83+
* @return The new current file on the token.
84+
* @throws IOException Upon card errors or when the selected file is not an EF.
85+
*/
5586
EFselectEF(intpath)throwsIOException;
5687

88+
/**
89+
* Select the master file on the token.
90+
*
91+
* @return The master file, which is now the current file.
92+
* @throws IOException Upon card errors.
93+
*/
5794
MFselectMF()throwsIOException;
5895

96+
/**
97+
* Read the content of the current EF-
98+
*
99+
* @return An input stream with the content of the current EF.
100+
* @throws IOException Upon card errors or when the current file is not an EF.
101+
*/
59102
InputStreamreadEFData()throwsIOException;
60103

104+
/**
105+
* Write to the content of the current EF.
106+
*
107+
* @return An output stream, which writes to the content of the current EF
108+
* @throws IOException Upon card errors or when the current file is not an EF.
109+
*/
61110
OutputStreamwriteEFData()throwsIOException;
62111

63112
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp