|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tools.codec.pkcs.AbstractTool
Base class for a family of tools for testing PKCS classes, and for demonstrating the functionality.
Field Summary | |
static String |
DESCR
The options descriptor for the abstract tool. |
protected KeyStore |
keystore_
The keystore. |
protected ArgsParser |
p_
The command line option parser to use. |
Constructor Summary | |
AbstractTool()
|
Method Summary | |
protected X509Certificate |
getCertificate(String alias)
Returns the X.509 certificate whose alias is defined in the command line parser option with the given name. |
protected KeyStore |
getKeyStore()
Returns the keystore. |
protected PrivateKey |
getPrivateKey(String alias,
String passwd)
Returns the private key whose alias is defined in the command line parser option with the given name. |
protected ASN1Type |
loadContentInfo(String option)
Loads a PKCS#7 ContentInfo and
returns its content. |
protected void |
saveContentInfo(ASN1RegisteredType rt,
String option)
Saves the given ASN1RegisteredType
in the file whose name is specified by the option with the
given name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DESCR
protected ArgsParser p_
protected KeyStore keystore_
Constructor Detail |
public AbstractTool()
Method Detail |
protected KeyStore getKeyStore() throws GeneralSecurityException, IOException, ArgsParserException
The options required by this method are
GeneralSecurityException
IOException
ArgsParserException
protected PrivateKey getPrivateKey(String alias, String passwd) throws GeneralSecurityException, IOException, ArgsParserException
alias
- The alias of the desired private key.passwd
- The password for the desired private key.
GeneralSecurityException
IOException
ArgsParserException
protected X509Certificate getCertificate(String alias) throws GeneralSecurityException, IOException, ArgsParserException
GeneralSecurityException
IOException
ArgsParserException
protected ASN1Type loadContentInfo(String option) throws IOException, ASN1Exception, ArgsParserException
ContentInfo
and
returns its content.
option
- The name of the option that specifies
the file.
IOException
ASN1Exception
ArgsParserException
protected void saveContentInfo(ASN1RegisteredType rt, String option) throws IOException, ASN1Exception, ArgsParserException
ASN1RegisteredType
in the file whose name is specified by the option with the
given name. Before saving, the type is wrapped in a ContentInfo
.
IOException
ASN1Exception
ArgsParserException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |