|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.didisoft.pgp.KeyStore
public class KeyStore
Represents an OpenPGP Key Store.
The KeyStore file contains both the public and secret key rings combined in one file and protected with password.
'
(In PGP (r) and GnuPG they are stored in two different files)
It can be used with PGPLib
in cases that require KeyStore
parameter,
or alone when only KeyStore or key generation operations are required.
Field Summary | |
---|---|
static java.lang.String |
DSA
DSA Algorithm constant, implementation of DH/DSS (signature) |
static java.lang.String |
EC
Elliptic Curve cryptography (ECC) in OpenPGP |
static java.lang.String |
ELGAMAL
ElGamal Algorithm constant, implementation of DH/DSS (encryption) |
static java.lang.String |
RSA
RSA Algorithm constant |
Constructor Summary | |
---|---|
KeyStore()
Creates a new Key Store object stored in-memory. |
|
KeyStore(java.lang.String keystoreFileName,
java.lang.String keystorePassword)
Creates a new Key Store object backed by a file. |
Method Summary | |
---|---|
void |
addCertification(long keyId,
long certKeyId,
java.lang.String certPassword,
java.lang.String userID)
Appends certification to a given OpenPGP key in the key store. |
void |
addUserId(long keyId,
java.lang.String privateKeyPassword,
java.lang.String newUserId)
Appends an additional User Id signature to a key contained in this key store. |
void |
changePrimaryUserId(long keyId,
java.lang.String privateKeyPassword,
java.lang.String newUserId)
Changes the primary (first) user Id signature of a key with a new user Id Example usage: Check the file KeyStoreChangeUserId.java located in the examples folder in the library archive. |
void |
changePrivateKeyPassword(long keyId,
java.lang.String oldPassword,
java.lang.String newPassword)
Changes private key password. |
boolean |
changePrivateKeyPassword(java.lang.String userId,
java.lang.String oldPassword,
java.lang.String newPassword)
Changes private key password. |
boolean |
changeUserId(long keyId,
java.lang.String privateKeyPassword,
java.lang.String oldUserId,
java.lang.String newUserId)
Changes an existing user Id signature of a key with a new user Id Example usage: Check the file KeyStoreChangeUserId.java located in the examples folder in the library archive. |
static boolean |
checkPassword(java.lang.String keystoreFileName,
java.lang.String password)
Checks if a password for a key store file is correct Example usage: |
boolean |
containsKey(long keyId)
Returns true if a public or private key with the specified Key Id exists in this KeyStore Example: |
boolean |
containsKey(java.lang.String userId)
Returns true if public or private key with the specified User ID exists in this KeyStore Example: |
boolean |
containsPrivateKey(long keyId)
Returns true if a private key with the specified Key Id exists in this KeyStore Example: |
boolean |
containsPrivateKey(java.lang.String userId)
Returns true if a private key with the specified User ID exists in this KeyStore Example: |
boolean |
containsPublicKey(long keyId)
Returns true if a public key with the specified Key Id exists in this KeyStore Example: |
boolean |
containsPublicKey(java.lang.String userId)
Returns true if a public key with the specified User ID exists in this KeyStore Example: |
void |
deleteKeyPair(long keyId)
Deletes public and private key pair from this key store that have the specified Key Id. |
boolean |
deleteKeyPair(java.lang.String userId)
Deletes the first public and private key pair from this key store that have the specified User Id. |
boolean |
deletePrivateKey(long keyId)
Deletes the first private key with the specified User Id from this KeyStore. |
boolean |
deletePrivateKey(java.lang.String userId)
Deletes the first private key with the specified User Id from this KeyStore. |
boolean |
deletePublicKey(long keyId)
Deletes the first public key with the specified Key Id from this KeyStore. |
boolean |
deletePublicKey(java.lang.String userId)
Deletes the first public key with the specified User Id from this KeyStore. |
boolean |
deleteUserId(long keyId,
java.lang.String userId)
Removes a user Id signature from a key Example usage: Check the file KeyStoreChangeUserId.java located in the examples folder in the library archive. |
void |
exportKeyRing(java.io.OutputStream outputStream,
long keyId,
boolean asciiArmor)
Exports Key ring (both public and private key) located in this Key store into a stream. |
void |
exportKeyRing(java.io.OutputStream outputStream,
java.lang.String userId,
boolean asciiArmor)
Exports Key ring (both public and private key) located in this Key store into a stream. |
void |
exportKeyRing(java.lang.String fileName,
long keyId,
boolean asciiArmor)
Exports Key ring (both public and private key) located in this Key store in one file. |
void |
exportKeyRing(java.lang.String fileName,
java.lang.String userId)
Exports Key ring (both public and private key) located in this Key store in one file. |
void |
exportKeyRing(java.lang.String fileName,
java.lang.String userId,
boolean asciiArmor)
Exports Key ring (both public and private key) located in this Key store in one file. |
void |
exportPrivateKey(java.io.OutputStream outputStream,
long keyId,
boolean asciiArmored)
Exports a private key from this KeyStore instance into a stream. |
void |
exportPrivateKey(java.io.OutputStream outputStream,
java.lang.String userId,
boolean asciiArmored)
Exports a private key from this OpenPGP key store into a stream. |
void |
exportPrivateKey(java.lang.String fileName,
long keyId,
boolean asciiArmored)
Exports private key from this KeyStore instance, into a file. |
void |
exportPrivateKey(java.lang.String fileName,
java.lang.String userId,
boolean asciiArmored)
Exports private key from this OpenPGP key store, into a file. |
void |
exportPublicKey(java.io.OutputStream outputStream,
long keyId,
boolean asciiArmored)
Exports public key from this KeyStore instance into a file. |
void |
exportPublicKey(java.io.OutputStream outputStream,
java.lang.String userId,
boolean asciiArmored)
Exports a public key from this KeyStore instance into a stream. |
void |
exportPublicKey(java.lang.String fileName,
long keyId,
boolean asciiArmored)
Exports public key from this KeyStore instance into a file. |
void |
exportPublicKey(java.lang.String fileName,
java.lang.String userId,
boolean asciiArmored)
Exports a public key from this KeyStore instance into a file. |
KeyPairInformation |
generateEccKeyPair(java.lang.String ecCurve,
java.lang.String userId,
java.lang.String privateKeyPassword)
Generates an OpenPGP key pair with Elliptic Curve cryptography (ECC) asymmetric encryption algorithm Default algorithms for the key are: Symmetric cipher: AES-256, AES-192, AES-128 Hash: SHA-512, SHA-384, SHA-256 Compression: ZIP, ZLIB, BZIP2, Uncompressed |
KeyPairInformation |
generateEccKeyPair(java.lang.String ecCurve,
java.lang.String userId,
java.lang.String privateKeyPassword,
long expirationAfterDays)
Generates an OpenPGP key pair with Elliptic Curve cryptography (ECC) asymmetric encryption algorithm Default algorithms for the key are: Symmetric cipher: AES-256, AES-192, AES-128 Hash: SHA-512, SHA-384, SHA-256 Compression: ZIP, ZLIB, BZIP2, Uncompressed |
KeyPairInformation |
generateEccKeyPair(java.lang.String ecCurve,
java.lang.String userId,
java.lang.String privateKeyPassword,
java.lang.String[] compressionTypes,
java.lang.String[] hashingAlgorithmTypes,
java.lang.String[] cipherTypes)
Generates an OpenPGP key pair with Elliptic Curve cryptography (ECC) asymmetric encryption algorithm Note: The generated key pair has no expiration date |
KeyPairInformation |
generateEccKeyPair(java.lang.String ecCurve,
java.lang.String userId,
java.lang.String privateKeyPassword,
java.lang.String[] compressionTypes,
java.lang.String[] hashingAlgorithmTypes,
java.lang.String[] cipherTypes,
long expirationAfterDays)
Generates an OpenPGP key pair with Elliptic Curve cryptography (ECC) asymmetric encryption algorithm |
KeyPairInformation |
generateElGamalKeyPair(int keySize,
java.lang.String userId,
java.lang.String password)
Generates OpenPGP Key pair with ElGamal (DH/DSS) encryption and predefined values for compression, hashing and cypher like the ones generated with PGP Desktop(tm) key generation wizard. |
KeyPairInformation |
generateKeyPair(int keySize,
java.lang.String userId,
java.lang.String password)
Generates OpenPGP Key pair with RSA encryption and predefined values for compression, hashing and cypher like the ones generated with PGP Desktop(tm) key generation wizard. |
KeyPairInformation |
generateKeyPair(int keySize,
java.lang.String userId,
java.lang.String keyAlgorithm,
java.lang.String password,
java.lang.String[] compressionTypes,
java.lang.String[] hashingAlgorithmTypes,
java.lang.String[] cipherTypes)
Generates OpenPGP key pair (public and private key). |
KeyPairInformation |
generateKeyPair(int keySize,
java.lang.String userId,
java.lang.String keyAlgorithm,
java.lang.String password,
java.lang.String[] compressionTypes,
java.lang.String[] hashingAlgorithmTypes,
java.lang.String[] cipherTypes,
long expirationAfterDays)
Generates OpenPGP key pair (public and private key). |
KeyPairInformation |
generateKeyPair(int keySize,
java.lang.String userId,
java.lang.String keyAlgorithm,
java.lang.String password,
java.lang.String compressionTypes,
java.lang.String hashingAlgorithmTypes,
java.lang.String cipherTypes)
Generates OpenPGP Key pair (public and private key). |
KeyPairInformation |
generateKeyPair(int keySize,
java.lang.String userId,
java.lang.String keyAlgorithm,
java.lang.String password,
java.lang.String compressionTypes,
java.lang.String hashingAlgorithmTypes,
java.lang.String cipherTypes,
long expirationAfterDays)
Generates OpenPGP Key pair (public and private key). |
KeyPairInformation |
generateRsaKeyPair(int keySize,
java.lang.String userId,
java.lang.String password)
Generates OpenPGP Key pair with RSA encryption and predefined values for compression, hashing and cypher like the ones generated with PGP Desktop(tm) key generation wizard. |
java.lang.String |
getAsciiVersionHeader()
Returns the Version comment text that is printed in ASCII armored output |
KeyPairInformation |
getKey(long keyId)
Returns the key pair with the specified Key Id |
KeyPairInformation |
getKey(java.lang.String userId)
Returns the key pair with the specified User Id |
java.lang.String[] |
getKeyHexIds()
Returns array of Hexadecimal string representation of the key Id's for the keys contained in this KeyStore instance. |
long |
getKeyIdForKeyIdHex(java.lang.String keyIdHex)
Returns the real Key ID (of type long ) corresponding to this Hexadecimal Key Id. |
long |
getKeyIdForUserId(java.lang.String userId)
Returns the real Key ID (of type long ) corresponding to this User Id. |
KeyPairInformation[] |
getKeys()
Returns the key pairs stored in this OpenPGP key store. |
java.lang.String |
getKeystoreFileName()
Returns this Key store file name (absolute or relative path) |
java.lang.String |
getKeystorePassword()
Returns The password of this KeyStore |
PGPPublicKeyRingCollection |
getRawPublicKeys()
Raw access to the secret keys contained in this KeyStore |
PGPSecretKeyRingCollection |
getRawSecretKeys()
Raw access to the secret keys contained in this KeyStore |
boolean |
getUsePrecomputedPrimes()
Returns will the key generation use build in precomputed primes. |
java.lang.String[] |
getUserIds()
Returns array of Strings representing all user Id's contained in this KeyStore instance. |
KeyPairInformation[] |
importKeyRing(java.io.InputStream keyStream)
Imports OpenPGP key ring stream into this KeyStore instance. |
KeyPairInformation[] |
importKeyRing(java.io.InputStream keyStream,
java.lang.String privateKeyPassword)
Imports OpenPGP key ring stream into this KeyStore instance. |
KeyPairInformation[] |
importKeyRing(java.lang.String keyRingFileName)
Imports OpenPGP key ring into this KeyStore instance. |
KeyPairInformation[] |
importKeyRing(java.lang.String keyRingFileName,
java.lang.String privateKeyPassword)
Imports OpenPGP key ring into this KeyStore instance. |
KeyPairInformation[] |
importKeyStore(KeyStore keyStore)
Imports the keys contained in another KeyStore object into the current instance. |
KeyPairInformation[] |
importPrivateKey(java.io.InputStream privateKeyStream)
Imports private key stream into this KeyStore instance. |
KeyPairInformation[] |
importPrivateKey(java.io.InputStream privateKeyStream,
java.lang.String password)
Imports private key stream into this KeyStore instance. |
KeyPairInformation[] |
importPrivateKey(java.lang.String privateKeyFileName)
Imports a private key file into this KeyStore instance. |
KeyPairInformation[] |
importPrivateKey(java.lang.String privateKeyFileName,
java.lang.String password)
Imports private key file into this KeyStore instance. |
KeyPairInformation[] |
importPublicKey(java.io.InputStream publicKeyStream)
Imports an OpenPGP public key into this KeyStore instance. |
KeyPairInformation[] |
importPublicKey(java.lang.String publicKeyFileName)
Imports an OpenPGP public key into this KeyStore instance. |
void |
importPublickKey(java.lang.String publicKeyFileName)
Deprecated. Replaced by importPublicKey(String) |
boolean |
isAutoSave()
Returns is auto save on. |
boolean |
isBackupOnSave()
Returns should backups be made on save. |
boolean |
isInMemory()
Indicates is this KeyStore instance stored in-memory |
boolean |
isPartialMatchUserIds()
Returns can Key User ID parameters be specified with part of the User ID (true) or with the whole User ID (false) |
boolean |
isSkipLucasLehmerPrimeTest()
Will Lucas-Lehmer prime number check be skipped when generating prime numbers for ElGamal keys. |
boolean |
isTrusted(long keyId)
Returns is a public key with the supplied Key Id trusted in this key store. |
boolean |
isTrusted(java.lang.String keyUserId)
Returns is a public key with the supplied Key User Id trusted in this key store. |
KeyPairInformation[] |
listKeys()
Lists keys stored in this OpenPGP key store to the System.out
Example: |
void |
loadFromStream(java.io.InputStream keystoreStream)
Loads the KeyStore data from a stream, where it has been stored previously |
void |
loadFromStream(java.io.InputStream keysStream,
java.lang.String password)
Loads the KeyStore data from a stream, where it has been stored previously. |
static KeyStore |
openFile(java.lang.String filename,
java.lang.String password)
Initializes a new Key Store object. |
static KeyStore |
openInMemory()
Creates a new in-memory KeyStore instance. |
void |
purge()
Clears the internal state of this key store. |
void |
save()
Saves the backing file of this KeyStore instance to disk. |
void |
saveToStream(java.io.OutputStream keystoreStream)
Saves the key store data to a stream The KeyStore is stored unprotected with a password |
void |
setAsciiVersionHeader(java.lang.String creator)
Sets the Version comment text that is printed in ASCII armored output Example usage: |
void |
setAutoSave(boolean save)
Sets the KeyStore to call save() automatically after each
operation that modifies it (for example import key, delete key, etc.) |
void |
setBackupOnSave(boolean backupOnSave)
Sets backup file be created (with extension .bak) for this KeyStore on save() operations. |
void |
setPartialMatchUserIds(boolean partialMatch)
Sets whether the library will use precomputed prime numbers for key generation |
void |
setSkipLucasLehmerPrimeTest(boolean skipLucasLehmerPrimeTest)
Sets should Lucas-Lehmer prime number check be skipped when generating prime numbers for ElGamal keys |
void |
setTrust(long keyId,
byte trustValue)
Sets an internal trust value for a public key, valid only in this KeyStore instance PGP command line (r) equivalent: pgp --set-trust keyId --trust trustValue |
void |
setTrust(java.lang.String keyUserId,
byte trustValue)
Sets an internal trust value for a public key, valid only in this KeyStore instance PGP command line (r) equivalent: pgp --set-trust keyUserId --trust trustValue |
void |
setUsePrecomputedPrimes(boolean usePrecomputedPrimes)
Sets whether the library will use precomputed prime numbers for key generation |
void |
signPublicKey(long keyId,
long signKeyId,
java.lang.String signPassword)
Signs a public key with a private key. |
void |
signPublicKey(java.lang.String keyUserId,
java.lang.String signKeyUserId,
java.lang.String signPassword)
Signs a public key with a private key. |
void |
signPublicKeyAsTrustedIntroducer(long keyId,
long signKeyId,
java.lang.String signPassword)
Signs a public key as trusted introducer When you import keys into your KeyStore and are sure that the trusted third party is really the person they claim to be, you can sign his/her keys. |
void |
signPublicKeyAsTrustedIntroducer(java.lang.String keyUserId,
java.lang.String signKeyUserId,
java.lang.String signPassword)
Signs a public key as a trusted introducer with a private key. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ELGAMAL
public static final java.lang.String DSA
public static final java.lang.String RSA
public static final java.lang.String EC
Constructor Detail |
---|
public KeyStore()
public KeyStore(java.lang.String keystoreFileName, java.lang.String keystorePassword) throws java.io.IOException, PGPException
keystoreFileName
- File name of the Key store (absolute or relative path)keystorePassword
- Password for the Key store.
java.io.IOException
- if an I/O error occurs
PGPException
- error decoding KeyStore data
{@link
- WrongPasswordException} of the password of the KeyStore is wrongMethod Detail |
---|
public static KeyStore openFile(java.lang.String filename, java.lang.String password) throws PGPException, java.io.IOException
filename
- File name of the Key store (absolute or relative path)password
- Password for the Key store.
PGPException
- if an error occurs decrypting the KeyStore contents
java.io.IOException
- if an I/O error occurspublic static KeyStore openInMemory()
public void purge() throws PGPException
PGPException
- error saving the key storepublic void loadFromStream(java.io.InputStream keysStream, java.lang.String password) throws java.io.IOException, PGPException
importKeyRing(InputStream)
or importKeyStore(KeyStore)
keystoreStream
- Input stream with keys,
saveToStream(OutputStream)
,
a KeyStore file stream, or a stream obtained from .asc files or PGP(r)/GnuPGP
.pkr and .skr keyring filespassword
- Password if the KeyStore was previously protected with a password
java.io.IOException
- in case of an I/O error
PGPException
- error decrypting the KeyStore datapublic void loadFromStream(java.io.InputStream keystoreStream) throws java.io.IOException, PGPException
keystoreStream
- KeyStore input stream
java.io.IOException
- in case of an I/O error
PGPException
- error decrypting the KeyStore datapublic void saveToStream(java.io.OutputStream keystoreStream) throws java.io.IOException
keystoreStream
- key store output stream
java.io.IOException
- in case of an I/O errorpublic boolean isPartialMatchUserIds()
setPartialMatchUserIds(boolean)
public void setPartialMatchUserIds(boolean partialMatch)
partialMatch
- if true, Key User ID parameters can be specified with part of the User ID
when false the whole User ID must be specifiedisPartialMatchUserIds()
public boolean getUsePrecomputedPrimes()
setUsePrecomputedPrimes(boolean)
public void setUsePrecomputedPrimes(boolean usePrecomputedPrimes)
usePrecomputedPrimes
- if true, the library will use precomputed prime numbers,
when false the library will generate prime numbers for each new key pairgetUsePrecomputedPrimes()
public boolean isInMemory()
public java.lang.String getAsciiVersionHeader()
setAsciiVersionHeader(String)
public void setAsciiVersionHeader(java.lang.String creator)
KeyStore ks = new KeyStore(); ks.setAsciiVersionHeader("My Application 1.1"); // Now in ASCII armored output will be printed "Version: My Application 1.1"
creator
- Program name and version that will be written in ASCII armored output Version: fieldpublic PGPSecretKeyRingCollection getRawSecretKeys()
public PGPPublicKeyRingCollection getRawPublicKeys()
public static boolean checkPassword(java.lang.String keystoreFileName, java.lang.String password) throws java.io.IOException
boolean passwordIsCorrect = KeyStore.checkPassword("c:\\java_pgp.keystore", password);
keystoreFileName
- File name of the KeyStore (absolute or relative path)password
- password for the KeyStore
java.io.IOException
- If the file does not exist or an I/O error occurpublic java.lang.String[] getUserIds()
KeyStore
instance.
KeyStore
instancepublic java.lang.String[] getKeyHexIds()
KeyStore
instance.
KeyStore
instancepublic long getKeyIdForUserId(java.lang.String userId)
long
) corresponding to this User Id.
userId
- User Id of the key owner.
long
) corresponding to this User Id.
If there is no key with such User Id -1
is returned.public long getKeyIdForKeyIdHex(java.lang.String keyIdHex)
long
) corresponding to this Hexadecimal Key Id.
long
for given hex key.
import com.didisoft.pgp.KeyStore;
public class KeyIdHexDemo {
public static void main(String[] args) throws Exception{
// initialize a KeyStore instance
KeyStore keyStore = new KeyStore("pgp.keystore", "changeit");
// get the key id corresponding to this hexadecimal key id
String hexKeyId = "74BB3286";
long keyId = keyStore.getKeyIdForKeyIdHex(hexKeyId);
if (keyId == -1) {
System.out.println("No key found with Key Id " + hexKeyId);
return;
}
// ... Now we can use keyId in the PGPLib
methods
// that accept KeyStore object and key id.
}
}
keyIdHex
- Hexadecimal Key Id used by other OpenPG software (e.g. PGP (r) and GnuPG).
long
) corresponding to this Hexadecimal Key Id.
If there is no key with such Hexadecimal Key Id -1
is returned.public void addCertification(long keyId, long certKeyId, java.lang.String certPassword, java.lang.String userID) throws PGPException
keyId
- Key ID of the key to receive this certificationcertKeyId
- certifying key IDcertPassword
- certifying key passworduserID
- user id giving the certification
NoPublicKeyFoundException
- No public key has been found with such Key Id
NoPrivateKeyFoundException
- No private key has been found with such Key Id
PGPException
- OpenPGP signing errorpublic void signPublicKey(long keyId, long signKeyId, java.lang.String signPassword) throws PGPException
KeyStore
and are sure that the trusted third party is really
the organization/person they claim to be, you can sign his/her keys.
import com.didisoft.pgp.*; public class SignKeyDemo { public static void main(String[] a) throws Exception { KeyStore keyStore = new KeyStore("mykeys.keystore", "password"); long partnerKeyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); long mySecretKeyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); keyStore.signPublicKey(partnerKeyId, mySecretKeyId, "my secret key password"); } }
keyId
- Key ID of the public key to be signedsignKeyId
- Key ID of the private key to used sign the public key withsignPassword
- Password of the private key
NoPublicKeyFoundException
- No public key has been found with such Key Id
NoPrivateKeyFoundException
- No private key has been found with such Key Id
PGPException
- OpenPGP signing errorpublic void signPublicKey(java.lang.String keyUserId, java.lang.String signKeyUserId, java.lang.String signPassword) throws PGPException
KeyStore
and are sure that trusted third party is really the person they claim, you can sign his/her keys.
Signing a key certifies that you know the owner of the keys.
import com.didisoft.pgp.*; public class SignKeyDemo { public static void main(String[] a) throws Exception { KeyStore keyStore = new KeyStore("mykeys.keystore", "password"); String partnerUserId = "Partner Company ACM"; long mySecretKeyUserId = "My Company my@company.com"; keyStore.signPublicKey(partnerUserId, mySecretKeyUserId, "my secret key password"); } }
keyUserId
- User Id of the public key to be signedsignKeyUserId
- User Id of the private key to sign the public key withsignPassword
- Password of the own private key
PGPException
public void signPublicKeyAsTrustedIntroducer(long keyId, long signKeyId, java.lang.String signPassword) throws PGPException
KeyStore
and are sure that the trusted third party is really the person they claim to be, you can sign his/her keys.
Signing a key certifies that you know the owner of the keys.
import com.didisoft.pgp.*; public class SignKeyDemo { public static void main(String[] a) throws Exception { KeyStore keyStore = new KeyStore("mykeys.keystore", "password"); long partnerKeyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); long mySecretKeyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); keyStore.signPublicKeyAsTrustedIntroducer(partnerKeyId, mySecretKeyId, "my secret key password"); } }
keyId
- Key ID of the public key to be signedsignKeyId
- Key ID of the private key to sign the public key withsignPassword
- Password of the own private key
NoPublicKeyFoundException
- No public key has been found with such Key Id
NoPrivateKeyFoundException
- No private key has been found with such Key Id
PGPException
- OpenPGP signing errorpublic void signPublicKeyAsTrustedIntroducer(java.lang.String keyUserId, java.lang.String signKeyUserId, java.lang.String signPassword) throws PGPException
KeyStore
and are sure that trusted third party is really the person they claim, you can sign his/her keys.
Signing a key certifies that you know the owner of the keys.
import com.didisoft.pgp.*; public class SignKeyDemo { public static void main(String[] a) throws Exception { KeyStore keyStore = new KeyStore("mykeys.keystore", "password"); String partnerUserId = "Partner Company ACM"; long mySecretKeyUserId = "My Company my@company.com"; keyStore.signPublicKey(partnerUserId, mySecretKeyUserId, "my secret key password"); } }
keyUserId
- User Id of the public key to be signedsignKeyUserId
- User Id of the private key to sign the public key withsignPassword
- Password of the own private key
NoPublicKeyFoundException
- No public key has been found with such Key Id
NoPrivateKeyFoundException
- No private key has been found with such Key Id
PGPException
- OpenPGP signing errorpublic void setTrust(long keyId, byte trustValue) throws PGPException, NoPublicKeyFoundException
keyId
- Key Id of the public keytrustValue
- trust amount see TrustLevel
for possible values
NoPublicKeyFoundException
- No public key has been found with such Key Id
PGPException
- OpenPGP signing errorTrustLevel}
,
isTrusted(long)
public void setTrust(java.lang.String keyUserId, byte trustValue) throws PGPException, NoPublicKeyFoundException
keyUserId
- User Id of the public keytrustValue
- trust amount see TrustLevel
for possible values
NoPublicKeyFoundException
- No public key has been found with such Key Id
PGPException
- OpenPGP signing errorTrustLevel}
,
isTrusted(long)
public boolean isTrusted(java.lang.String keyUserId) throws PGPException
keyUserId
- User Id of the key to be checked
PGPException
- General OpenPGP error
NoPublicKeyFoundException
- No public key has been found with such Key Id#setTrust(long, byte)}
,
signPublicKey(long, long, String)
,
signPublicKeyAsTrustedIntroducer(long, long, String)
,
getKeyIdForKeyIdHex(String)
public boolean isTrusted(long keyId) throws PGPException
keyId
- Key Id of the key to be checked
NoPublicKeyFoundException
- No public key has been found with such Key Id
PGPException
- General OpenPGP error#setTrust(long, byte)}
,
signPublicKey(long, long, String)
,
signPublicKeyAsTrustedIntroducer(long, long, String)
public boolean deleteKeyPair(java.lang.String userId) throws PGPException
import com.didisoft.pgp.KeyStore; public class DeleteKeyPair { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // delete the key pair with this User Id ks.deleteKeyPair("test@gmail.com"); } }
userId
- User Id of the form "name (comment) <email address>"
PGPException
public boolean deletePrivateKey(java.lang.String userId) throws PGPException
import com.didisoft.pgp.KeyStore; public class DeletePrivateKeyDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // delete the private key with this User Id ks.deletePrivateKey("test@gmail.com"); } }
userId
- User Id of the form "name (comment) <email address>"
PGPException
public boolean deletePrivateKey(long keyId) throws PGPException
import com.didisoft.pgp.KeyStore; public class DeletePrivateKeyDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // delete the private key with this Key Id long privateKeyId = ks.getKeyIdForKeyIdHex("2EDE06AC"); ks.deletePrivateKey(privateKeyId); } }
keyId
- Key Id of the private key to be deleted
PGPException
public boolean deletePublicKey(java.lang.String userId) throws PGPException
import com.didisoft.pgp.KeyStore; public class DeletePublicKeyDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // delete the public key with this User Id ks.deletePublicKey("test@gmail.com"); } }
userId
- User Id of the form "name (comment) <email address>"
PGPException
public boolean deletePublicKey(long keyId) throws PGPException
import com.didisoft.pgp.KeyStore; public class DeletePublicKeyDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // delete the public key with this Key Id long privateKeyId = ks.getKeyIdForKeyIdHex("2EDE06AC"); ks.deletePublicKey(privateKeyId); } }
keyId
- Key Id of the public key to be deleted
PGPException
public void deleteKeyPair(long keyId) throws PGPException
import com.didisoft.pgp.KeyStore; public class DeleteKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // delete the key pair with this Key Id long keyId = ks.getKeyIdForKeyIdHex("2EDE06AC"); ks.deleteKeyPair(keyId); } }
keyId
- Key ID of the key pair
PGPException
public boolean changePrivateKeyPassword(java.lang.String userId, java.lang.String oldPassword, java.lang.String newPassword) throws WrongPasswordException, PGPException
import com.didisoft.pgp.KeyStore; public class ChangePrivateKeyPasswordDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // change the key password ks.changePrivateKeyPassword("My Company", "old password", "new password"); } }
userId
- private key User Id of the form "name (comment) <email address>"oldPassword
- current password of the private keynewPassword
- new password of the private key
WrongPasswordException
- if the old password is incorrect
PGPException
- general errorpublic void changePrivateKeyPassword(long keyId, java.lang.String oldPassword, java.lang.String newPassword) throws NoPrivateKeyFoundException, WrongPasswordException, PGPException
import com.didisoft.pgp.KeyStore; public class ChangePrivateKeyPasswordDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // change the key password long keyId = ks.getKeyIdForKeyIdHex("2EDE06AC"); ks.changePrivateKeyPassword(keyId, "old password", "new password"); } }
keyId
- Key Id of the private keyoldPassword
- current password of the private keynewPassword
- new password of the private key
NoPrivateKeyFoundException
- no private key with the specified Key Id has been found
WrongPasswordException
- if the old password is incorrect
PGPException
- general errorgetKeyIdForKeyIdHex(String)
,
getKeyIdForUserId(String)
,
getKeyIdForKeyIdHex(String)
public void addUserId(long keyId, java.lang.String privateKeyPassword, java.lang.String newUserId) throws NoPublicKeyFoundException, NoPrivateKeyFoundException, WrongPasswordException, PGPException
keyId
- target key IdprivateKeyPassword
- the password of the corresponding private keynewUserId
- the new user Id to be added
NoPublicKeyFoundException
- if there is no public key with the specified key Id
NoPrivateKeyFoundException
- if there is no corresponding private key
WrongPasswordException
- if the specified password for the private key is wrong
PGPException
- general exceptiongetKeyIdForUserId(String)
,
getKeyIdForKeyIdHex(String)
public boolean deleteUserId(long keyId, java.lang.String userId) throws NoPublicKeyFoundException, PGPException
keyId
- target key IduserId
- user Id to be removed
NoPublicKeyFoundException
- if there is no public key with the specified key Id
PGPException
- general exceptiongetKeyIdForUserId(String)
,
getKeyIdForKeyIdHex(String)
public boolean changeUserId(long keyId, java.lang.String privateKeyPassword, java.lang.String oldUserId, java.lang.String newUserId) throws NoPublicKeyFoundException, NoPrivateKeyFoundException, WrongPasswordException, PGPException
keyId
- target key IdprivateKeyPassword
- the password of the corresponding private keyoldUserId
- the old user Id to be changednewUserId
- the new user Id to be added
NoPublicKeyFoundException
- if there is no public key with the specified key Id
NoPrivateKeyFoundException
- if there is no corresponding private key
WrongPasswordException
- if the specified password for the private key is wrong
PGPException
- general exceptiongetKeyIdForUserId(String)
,
getKeyIdForKeyIdHex(String)
public void changePrimaryUserId(long keyId, java.lang.String privateKeyPassword, java.lang.String newUserId) throws NoPublicKeyFoundException, NoPrivateKeyFoundException, WrongPasswordException, PGPException
keyId
- target key IdprivateKeyPassword
- the password of the corresponding private keynewUserId
- the new user Id to be added
NoPublicKeyFoundException
- if there is no public key with the specified key Id
NoPrivateKeyFoundException
- if there is no corresponding private key
WrongPasswordException
- if the specified password for the private key is wrong
PGPException
- general exceptiongetKeyIdForUserId(String)
,
getKeyIdForKeyIdHex(String)
public KeyPairInformation generateEccKeyPair(java.lang.String ecCurve, java.lang.String userId, java.lang.String privateKeyPassword) throws PGPException
ecCurve
- Elliptic curve of the key pair (see EcCurve
for supported curves)userId
- user Id of this keyprivateKeyPassword
- password for the private key (can be empty string if none)
KeyPairInformation
object representing the newly created key pair
PGPException
- if an error occurs
import com.didisoft.pgp.*; public class GenerateEccKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // EC curve for this key String curve = EcCurve.P384; // User Id for this key String userId = "My Company"; KeyPairInformation newKey = ks.generateEccKeyPair(curve, userId, "my key password"); // now the public key can be exported and sent to our partners } }
public KeyPairInformation generateEccKeyPair(java.lang.String ecCurve, java.lang.String userId, java.lang.String privateKeyPassword, long expirationAfterDays) throws PGPException
ecCurve
- Elliptic curve of the key pair (see EcCurve
for supported curves)userId
- user Id of this keyprivateKeyPassword
- password for the private key (can be empty string if none)expirationAfterDays
- the key validity period in days
KeyPairInformation
object representing the newly created key pair
PGPException
- if an error occurs
import com.didisoft.pgp.*; public class GenerateEccKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // EC curve for this key String curve = EcCurve.P384; // User Id for this key String userId = "My Company"; // the key will be valid for 1 year long keyExpiresAfter = 365; KeyPairInformation newKey = ks.generateEccKeyPair(curve, userId, "my key password", keyExpiresAfter); // now the public key can be exported and sent to our partners } }
public KeyPairInformation generateEccKeyPair(java.lang.String ecCurve, java.lang.String userId, java.lang.String privateKeyPassword, java.lang.String[] compressionTypes, java.lang.String[] hashingAlgorithmTypes, java.lang.String[] cipherTypes) throws PGPException
ecCurve
- Elliptic curve of the key pair (see EcCurve
for supported curves)userId
- user Id of this keyprivateKeyPassword
- password for the private key (can be empty string if none)compressionTypes
- Compression algorithms supported by the key. (see CompressionAlgorithm
)hashingAlgorithmTypes
- Hashing algorithms supported by the key. (see HashAlgorithm
)cipherTypes
- Symmetric algorithms supported by the key. (see CypherAlgorithm
)
KeyPairInformation
object representing the newly created key pair
PGPException
- if an error occurs
java.lang.IllegalArgumentException
- if the curve parameter or one of the preferred algorithms parameters is invalid
import com.didisoft.pgp.*; public class GenerateEccKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // EC curve for this key String curve = EcCurve.P384; // User Id for this key String userId = "My Company"; // preferred compression algorithms String[] compressions = new String[] {CompressionAlgorithm.ZIP, CompressionAlgorithm.ZLIB, CompressionAlgorithm.UNCOMPRESSED}; // preferred hashing algorithms String[] hashingAlgorithms = new String[] {HashAlgorithm.SHA512, HashAlgorithm.SHA256, HashAlgorithm.SHA384}; // preferred symmetric key algorithms String[] cyphers = new String[] {CypherAlgorithm.AES_256, CypherAlgorithm.AES_128, CypherAlgorithm.AES_192}; KeyPairInformation newKey = ks.generateEccKeyPair(curve, userId, "my key password", compressions, hashingAlgorithms, cyphers); // now the public key can be exported and sent to our partners } }
public KeyPairInformation generateEccKeyPair(java.lang.String ecCurve, java.lang.String userId, java.lang.String privateKeyPassword, java.lang.String[] compressionTypes, java.lang.String[] hashingAlgorithmTypes, java.lang.String[] cipherTypes, long expirationAfterDays) throws PGPException
ecCurve
- Elliptic curve of the key pair (see EcCurve
for supported curves)userId
- user Id of this keyprivateKeyPassword
- password for the private key (can be empty string if none)compressionTypes
- Compression algorithms supported by the key. (see CompressionAlgorithm
)hashingAlgorithmTypes
- Hashing algorithms supported by the key. (see HashAlgorithm
)cipherTypes
- Symmetric algorithms supported by the key. (see CypherAlgorithm
)expirationAfterDays
- the key validity period in days
KeyPairInformation
object representing the newly created key pair
PGPException
- if an error occurs
java.lang.IllegalArgumentException
- if the curve parameter or one of the preferred algorithms parameters is invalid
import com.didisoft.pgp.*; public class GenerateEccKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // EC curve for this key String curve = EcCurve.P384; // User Id for this key String userId = "My Company"; // preferred compression algorithms String[] compressions = new String[] {CompressionAlgorithm.ZIP, CompressionAlgorithm.ZLIB, CompressionAlgorithm.UNCOMPRESSED}; // preferred hashing algorithms String[] hashingAlgorithms = new String[] {HashAlgorithm.SHA512, HashAlgorithm.SHA256, HashAlgorithm.SHA384}; // preferred symmetric key algorithms String[] cyphers = new String[] {CypherAlgorithm.AES_256, CypherAlgorithm.AES_128, CypherAlgorithm.AES_192}; // the key will be valid for 1 year long keyExpiresAfter = 365; KeyPairInformation newKey = ks.generateEccKeyPair(curve, userId, "my key password", compressions, hashingAlgorithms, cyphers, keyExpiresAfter); // now the public key can be exported and sent to our partners } }
public KeyPairInformation generateRsaKeyPair(int keySize, java.lang.String userId, java.lang.String password) throws PGPException
keySize
- size of the keys
import com.didisoft.pgp.KeyStore; public class GenerateRSAKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); int keySize = 2048; // User Id for this key String userId = "My Company"; KeyPairInformation newKey = ks.generateRsaKeyPair(keyId, userId, "key password"); // now the public key can be exported and sent to our partners } }
userId
- User Id of the form "name (comment) <email address>"password
- Secret key password
KeyPairInformation
object representing the generated key pair
PGPException
- Key generation errorpublic KeyPairInformation generateElGamalKeyPair(int keySize, java.lang.String userId, java.lang.String password) throws PGPException
keySize
- size of the keys
userId
- User Id of the form "name (comment) <email address>"password
- Secret key password
import com.didisoft.pgp.KeyStore; public class GenerateRSAKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); int keySize = 2048; // User Id for this key String userId = "My Company"; KeyPairInformation newKey = ks.generateElgamalKeyPair(keyId, userId, "key password"); // now the public key can be exported and sent to our partners } }
KeyPairInformation
object representing the generated key pair
PGPException
- Key generation errorpublic KeyPairInformation generateKeyPair(int keySize, java.lang.String userId, java.lang.String password) throws PGPException
keySize
- size of the keys
import com.didisoft.pgp.KeyStore; public class GenerateRSAKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the KeyStore instance KeyStore ks = new KeyStore("pgp.keystore", "changeit"); int keySize = 2048; // User Id for this key String userId = "My Company"; KeyPairInformation newKey = ks.generateKeyPair(keyId, userId, "key password"); // now the public key can be exported and sent to our partners } }
userId
- User Id of the form "name (comment) <email address>"password
- Secret key password
KeyPairInformation
object representing the generated key pair
PGPException
- Key generation errorpublic KeyPairInformation generateKeyPair(int keySize, java.lang.String userId, java.lang.String keyAlgorithm, java.lang.String password, java.lang.String[] compressionTypes, java.lang.String[] hashingAlgorithmTypes, java.lang.String[] cipherTypes) throws PGPException
import com.didisoft.pgp.*; public class GenerateKeyPairRSA { public static void main(String[] args) throws Exception { // initialize the KeyStore where the key will be generated KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // key primary user Id String userId = "demo2@didisoft.com"; // preferred hashing algorithms String[] hashingAlgorithms = new String[] {HashAlgorithm.SHA1, HashAlgorithm.SHA256, HashAlgorithm.SHA384, HashAlgorithm.SHA512, HashAlgorithm.MD5}; // preferred compression algorithms String[] compressions = new String[] {CompressionAlgorithm.ZIP, CompressionAlgorithm.ZLIB, CompressionAlgorithm.UNCOMPRESSED}; // preferred symmetric key algorithms String[] cyphers = new String[] {CypherAlgorithm.CAST5, CypherAlgorithm.AES_128, CypherAlgorithm.AES_192, CypherAlgorithm.AES_256, CypherAlgorithm.TWOFISH}; String privateKeyPassword = "changeit"; int keySizeInBits = 2048; ks.generateKeyPair(keySizeInBits, userId, KeyAlgorithm.RSA, privateKeyPassword, compressions, hashingAlgorithms, cyphers); } }
keySize
- Size of the keys in bits
userId
- User Id of the form "name (comment) <email address>"keyAlgorithm
- Key algorithm. Possible values: ELGAMAL, RSApassword
- Secret key password.compressionTypes
- Compression algorithms supported by the key. (see CompressionAlgorithm
)hashingAlgorithmTypes
- Hashing algorithms supported by the key. (see HashAlgorithm
)cipherTypes
- Symmetric algorithms supported by the key. (see CypherAlgorithm
)
KeyPairInformation
object representing the generated key pair
PGPException
- Key generation error
CompressionAlgorithm
public KeyPairInformation generateKeyPair(int keySize, java.lang.String userId, java.lang.String keyAlgorithm, java.lang.String password, java.lang.String[] compressionTypes, java.lang.String[] hashingAlgorithmTypes, java.lang.String[] cipherTypes, long expirationAfterDays) throws PGPException
import com.didisoft.pgp.*; public class GenerateKeyPairRSA { public static void main(String[] args) throws Exception { // initialize the KeyStore where the key will be generated KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // key primary user Id String userId = "demo2@didisoft.com"; // preferred hashing algorithms String[] hashingAlgorithms = new String[] {HashAlgorithm.SHA1, HashAlgorithm.SHA256, HashAlgorithm.SHA384, HashAlgorithm.SHA512, HashAlgorithm.MD5}; // preferred compression algorithms String[] compressions = new String[] {CompressionAlgorithm.ZIP, CompressionAlgorithm.ZLIB, CompressionAlgorithm.UNCOMPRESSED}; // preferred symmetric key algorithms String[] cyphers = new String[] {CypherAlgorithm.CAST5, CypherAlgorithm.AES_128, CypherAlgorithm.AES_192, CypherAlgorithm.AES_256, CypherAlgorithm.TWOFISH}; String privateKeyPassword = "changeit"; // The key will expire after 1 year // set this to 0 if the key will never expire long keyExpiresAfterDays = 365; int keySizeInBits = 2048; ks.generateKeyPair(keySizeInBits, userId, KeyAlgorithm.RSA, privateKeyPassword, compressions, hashingAlgorithms, cyphers, keyExpiresAfterDays); } }
keySize
- Size of the keys in bits
userId
- User Id of the form "name (comment) <email address>"keyAlgorithm
- Key algorithm. Possible values: ELGAMAL, RSApassword
- Secret key password.compressionTypes
- Compression algorithms supported by the key. (see CompressionAlgorithm
)hashingAlgorithmTypes
- Hashing algorithms supported by the key. (see HashAlgorithm
)cipherTypes
- Symmetric algorithms supported by the key. (see CypherAlgorithm
)expirationAfterDays
- key validity period in days
KeyPairInformation
object representing the generated key pair
PGPException
- Key generation error
CompressionAlgorithm
public KeyPairInformation generateKeyPair(int keySize, java.lang.String userId, java.lang.String keyAlgorithm, java.lang.String password, java.lang.String compressionTypes, java.lang.String hashingAlgorithmTypes, java.lang.String cipherTypes) throws PGPException
keySize
- Size of the keys in bits
userId
- User Id of the form "name (comment) <email address>"keyAlgorithm
- Key algorithm. Possible values: ELGAMAL, RSApassword
- Secret key password.compressionTypes
- Compression algorithms supported by the key. hashingAlgorithmTypes
- Hashing algorithms supported by the key. cipherTypes
- Symmetric algorithms supported by the key. KeyPairInformation
object representing the generated key pair
PGPException
- Key generation errorpublic KeyPairInformation generateKeyPair(int keySize, java.lang.String userId, java.lang.String keyAlgorithm, java.lang.String password, java.lang.String compressionTypes, java.lang.String hashingAlgorithmTypes, java.lang.String cipherTypes, long expirationAfterDays) throws PGPException
import com.didisoft.pgp.*; public class GenerateKeyPairRSA { public static void main(String[] args) throws Exception { // initialize the KeyStore where the key will be generated KeyStore ks = new KeyStore("pgp.keystore", "changeit"); // key primary user Id String userId = "demo2@didisoft.com"; // preferred hashing algorithms String[] hashingAlgorithms = new String[] {HashAlgorithm.SHA1, HashAlgorithm.SHA256, HashAlgorithm.SHA384, HashAlgorithm.SHA512, HashAlgorithm.MD5}; // preferred compression algorithms String[] compressions = new String[] {CompressionAlgorithm.ZIP, CompressionAlgorithm.ZLIB, CompressionAlgorithm.UNCOMPRESSED}; // preferred symmetric key algorithms String[] cyphers = new String[] CypherAlgorithm.CAST5, CypherAlgorithm.AES_128, CypherAlgorithm.AES_192, CypherAlgorithm.AES_256, CypherAlgorithm.TWOFISH}; String privateKeyPassword = "changeit"; // the key will be valid for 1 year long keyExpiresAfter = 365; int keySizeInBits = 2048; ks.generateKeyPair(keySizeInBits, userId, KeyAlgorithm.RSA, privateKeyPassword, compressions, hashingAlgorithms, cyphers, keyExpiresAfter); } }
keySize
- Size of the keys in bits
userId
- User Id of the form "name (comment) <email address>"keyAlgorithm
- Key algorithm. Possible values: RSA, ELGAMAL (equivalent of DS/DHH)password
- Secret key password.compressionTypes
- Compression algorithms supported by the key. hashingAlgorithmTypes
- Hashing algorithms supported by the key. cipherTypes
- Symmetric algorithms supported by the key. expirationAfterDays
- Number of days the key will be valid. For example 365 for one year. Use 0 (zero) for no expiration date.
KeyPairInformation
object representing the generated key pair
PGPException
- Key generation errorpublic void exportKeyRing(java.lang.String fileName, java.lang.String userId) throws NoPublicKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // export key pair with this User Id keyStore.exportKeyRing("keypair.asc", "demo@didisoft.com"); } }
fileName
- File name where the key ring will be exported (absolute or relative path)userId
- User Id of the form "name (comment) <email address>"
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- I/O error saving the key ringpublic void exportKeyRing(java.lang.String fileName, java.lang.String userId, boolean asciiArmor) throws NoPublicKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("my.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; // export key pair with this User Id keyStore.exportKeyRing("keypair.asc", "demo@didisoft.com", asciiArmored); } }
fileName
- File name where the key ring will be exported (absolute or relative path)userId
- User Id of the form "name (comment) <email address>"asciiArmor
- if true the output is ASCII armored, when false it is binary
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- I/O error saving the key ringpublic void exportKeyRing(java.io.OutputStream outputStream, java.lang.String userId, boolean asciiArmor) throws NoPublicKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("my.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; // export key pair with this User Id OutputStream keyData = new ByteArrayOutputStream(); keyStore.exportKeyRing(keyData, "demo@didisoft.com", asciiArmored); // keyData has to be closed ... } }
outputStream
- OutputStream where the key data will be writtenuserId
- User Id of the form "name (comment) <email address>"asciiArmor
- if true the output is ASCII armored, when false it is binary
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- I/O error saving the key ringpublic void exportKeyRing(java.io.OutputStream outputStream, long keyId, boolean asciiArmor) throws NoPublicKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("my.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); // export key pair with this User Id OutputStream keyData = new ByteArrayOutputStream(); keyStore.exportKeyRing(keyData, keyId, asciiArmored); // keyData has to be closed ... } }
outputStream
- OutputStream where the key data will be writtenuserId
- User Id of the form "name (comment) <email address>"asciiArmor
- if true the output is ASCII armored, when false it is binary
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- I/O error saving the key ringpublic void exportKeyRing(java.lang.String fileName, long keyId, boolean asciiArmor) throws NoPublicKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportKeyPairDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("my.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); // export key pair with this User Id keyStore.exportKeyRing("keypair.asc", keyId, asciiArmored); } }
fileName
- File name where the key ring will be exported (absolute or relative path)keyId
- Key Id of the keyring to be exportedasciiArmor
- if true the output is ASCII armored, when false it is binary
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- I/O error saving the key ringpublic void exportPublicKey(java.lang.String fileName, java.lang.String userId, boolean asciiArmored) throws NoPublicKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportPublicKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; // export the public key with this User Id keyStore.exportPublicKey("public_key.asc", "demo@didisoft.com", asciiArmored); } }
fileName
- File name where the public key will be exported (absolute or relative path)userId
- User Id of the form "name (comment) <email address>"asciiArmored
- if true the output is ASCII armored, when false it is binary
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- if an I/O error occurs.public void exportPublicKey(java.io.OutputStream outputStream, java.lang.String userId, boolean asciiArmored) throws NoPublicKeyFoundException, java.io.IOException
import java.io.*; import com.didisoft.pgp.KeyStore; public class ExportPublicKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; // export the public key with this User Id OutputStream keyData = new ByteArrayOutputStream(); keyStore.exportPublicKey(keyData, "demo@didisoft.com", asciiArmored); // keyData has to be closed ... } }
outputStream
- OutputStream where the key data will be writtenuserId
- User Id of the form "name (comment) <email address>"asciiArmored
- if true the output is ASCII armored, when false it is binary
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- if an I/O error occurs.public void exportPublicKey(java.io.OutputStream outputStream, long keyId, boolean asciiArmored) throws NoPublicKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportPublicKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); // export key pair with this User Id OutputStream keyData = new ByteArrayOutputStream(); keyStore.exportPublicKey(keyData, keyId, asciiArmored); } }
outputStream
- OutputStream where the key data will be writtenkeyId
- Key Id of the Public KeyasciiArmored
- if true the output is ASCII armored, when false it is binary
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- if an I/O error occurs.public void exportPublicKey(java.lang.String fileName, long keyId, boolean asciiArmored) throws NoPublicKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportPublicKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); // export key pair with this User Id keyStore.exportPublicKey("public_key.asc", keyId, asciiArmored); } }
fileName
- File name where the public key will be exported (absolute or relative path)keyId
- Key Id of the Public KeyasciiArmored
- if true the output is ASCII armored, when false it is binary
NoPublicKeyFoundException
- if there is no such key
java.io.IOException
- if an I/O error occurs.public void exportPrivateKey(java.lang.String fileName, java.lang.String userId, boolean asciiArmored) throws NoPrivateKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportPrivateKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; // export key pair with this User Id keyStore.exportPrivateKey("private_key.asc", "demo@didisoft.com", asciiArmored); } }
fileName
- File name where the key will be exported (absolute or relative path)userId
- User Id of the form "name (comment) <email address>"asciiArmored
- if true the output is ASCII armored, when false it is binary
NoPrivateKeyFoundException
- if there is no such key
java.io.IOException
- if an I/O error occurs.public void exportPrivateKey(java.io.OutputStream outputStream, java.lang.String userId, boolean asciiArmored) throws NoPrivateKeyFoundException, java.io.IOException
import java.io.*; import com.didisoft.pgp.KeyStore; public class ExportPrivateKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; // export key pair with this User Id OutputStream keyData = new ByteArrayOutputStream(); keyStore.exportPrivateKey(keyData, "demo@didisoft.com", asciiArmored); // keyData has to be closed ... } }
outputStream
- OutputStream where the key data will be writtenuserId
- User Id of the form "name (comment) <email address>"asciiArmored
- if true the output is ASCII armored, when false it is binary
NoPrivateKeyFoundException
- if there is no such key
java.io.IOException
- if an I/O error occurs.public void exportPrivateKey(java.io.OutputStream outputStream, long keyId, boolean asciiArmored) throws NoPrivateKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportPrivateKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); // export key pair with this User Id OutputStream keyData = new ByteArrayOutputStream(); keyStore.exportPrivateKey(keyData, keyId, asciiArmored); // keyData has to be closed ... } }
outputStream
- OutputStream where the key data will be writtenkeyId
- Key Id of the corresponding Public KeyasciiArmored
- if true the output is ASCII armored, when false it is binary
NoPrivateKeyFoundException
- if there is no such key
java.io.IOException
- if an I/O error occurs.public void exportPrivateKey(java.lang.String fileName, long keyId, boolean asciiArmored) throws NoPrivateKeyFoundException, java.io.IOException
import com.didisoft.pgp.KeyStore; public class ExportPrivateKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // should the exported key be in ASCII form (true), or binary (false) boolean asciiArmored = true; long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); // export key pair with this User Id keyStore.exportPrivateKey("private_key.asc", keyId, asciiArmored); } }
fileName
- File name where the key will be exported (absolute or relative path)keyId
- Key Id of the corresponding Public KeyasciiArmored
- if true the output is ASCII armored, when false it is binary
NoPrivateKeyFoundException
- if there is no such key
java.io.IOException
- if an I/O error occurs.public void importPublickKey(java.lang.String publicKeyFileName) throws java.io.IOException, PGPException
importPublicKey(String)
publicKeyFileName
- FileName of the Public key to be imported (absolute or relative path)
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- if PGP object different from public or private key is found in this fileimportKeyRing(String)
,
exportKeyRing(String, String)
public KeyPairInformation[] importPublicKey(java.lang.String publicKeyFileName) throws java.io.IOException, PGPException, NoPublicKeyFoundException
import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // import key keyStore.importPublicKey("public_key.asc"); } }
publicKeyFileName
- FileName of the Public key to be imported (absolute or relative path)
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- general PGP decoding/parsing error
NoPublicKeyFoundException
- if the supplied file does not contain public key(s)public KeyPairInformation[] importPublicKey(java.io.InputStream publicKeyStream) throws java.io.IOException, PGPException, NoPublicKeyFoundException
import java.io.*; import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); InputStream keyStream = new FileInputStream("public_key.asc"); // import key keyStore.importPublicKey(keyStream); keyStream.close(); } }
publicKeyStream
- stream containing the public key to be imported
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- general PGP decoding/parsing error
NoPublicKeyFoundException
- if the supplied file does not contain public key(s)public KeyPairInformation[] importKeyRing(java.lang.String keyRingFileName) throws java.io.IOException, PGPException
import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // import key keyStore.importKeyRing("mykey.asc"); } }
keyRingFileName
- FileName of the key ring to be imported (absolute or relative path). Most common file name extensions are .asc, .pkr, .skr, .pgp, .pgpkey
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- if PGP object different from public or private key is found in this fileexportKeyRing(String, String)
public KeyPairInformation[] importKeyStore(KeyStore keyStore) throws java.io.IOException, PGPException
// The source KeyStore is located in a file KeyStore ksSource = new KeyStore("my.keystore", "my password"); // The destination KeyStore is in-memory KeyStore ksDestination = new KeyStore(); KeyPairInformation[] importedKeys = ksDestination.importKeyStore( ksSource );
keyStore
- source KeyStore to import from
KeyPairInformation
objects representing the imported keys
java.io.IOException
- I/O error
PGPException
- error decoding keypublic KeyPairInformation[] importKeyRing(java.lang.String keyRingFileName, java.lang.String privateKeyPassword) throws java.io.IOException, PGPException
import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // import key keyStore.importKeyRing("mykey.asc", "my password"); } }
keyRingFileName
- FileName of the key ring to be imported (absolute or relative path). Most common file name extensions are .asc, .pgp, .pgpkeyprivateKeyPassword
- password of the private key component if exists, in the supplied file
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- if PGP object different from public or private key is found in this file
WrongPasswordException
- if a private key component exists in the specified file and its password does not matchexportKeyRing(String, String)
public KeyPairInformation[] importKeyRing(java.io.InputStream keyStream) throws java.io.IOException, PGPException
import java.io.*; import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); InputStream stream = new FileInputStream("mykey.asc"); // import key keyStore.importKeyRing(stream); stream.close(); } }
keyStream
- OpenPGP key ring to be imported in stream format.privateKeyPassword
- password of the private key if exists
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- if PGP object different from public or private key is found in this file
WrongPasswordException
- if a private key component exists in the specified file and its password does not matchexportKeyRing(String, String)
public KeyPairInformation[] importKeyRing(java.io.InputStream keyStream, java.lang.String privateKeyPassword) throws java.io.IOException, PGPException
import java.io.*; import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); InputStream stream = new FileInputStream("mykey.asc"); // import key keyStore.importKeyRing(stream, "private key password"); } }
keyStream
- Input stream obtained from an .asc key file or .pkr/.skr keyring sourceprivateKeyPassword
- password of the private key if exists
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- if PGP object different from public or private key is found in this file
WrongPasswordException
- if a private key component exists in the specified file and its password does not matchexportKeyRing(String, String)
public KeyPairInformation[] importPrivateKey(java.lang.String privateKeyFileName) throws java.io.IOException, PGPException, NoPrivateKeyFoundException
import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // import key keyStore.importPrivateKey("mykey.asc"); } }
privateKeyFileName
- File of the Private key to be imported (absolute or relative path)
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- general PGP decoding/parsing error
NoPrivateKeyFoundException
- if the supplied file does not contain private key(s)public KeyPairInformation[] importPrivateKey(java.lang.String privateKeyFileName, java.lang.String password) throws java.io.IOException, PGPException, NoPrivateKeyFoundException
import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); // import key keyStore.importPrivateKey("mykey.asc", "key password"); } }
privateKeyFileName
- File of the Private key to be imported (absolute or relative path)password
- Password of the private key
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- general PGP decoding/parsing error
NoPrivateKeyFoundException
- if the supplied file does not contain private key(s)
WrongPasswordException
- if the supplied private key password is incorrectpublic KeyPairInformation[] importPrivateKey(java.io.InputStream privateKeyStream) throws java.io.IOException, PGPException, NoPrivateKeyFoundException
import java.io.*; import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); InputStream keyStream = new FileInputStream("mykey.asc"); // import key keyStore.importPrivateKey(keyStream); // the caller has to close the stream keyStream.close(); } }
privateKeyStream
- Input stream containing the key to be imported
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- general PGP decoding/parsing error
NoPrivateKeyFoundException
- if the supplied file does not contain private key(s)
WrongPasswordException
- if the supplied private key password is incorrectpublic KeyPairInformation[] importPrivateKey(java.io.InputStream privateKeyStream, java.lang.String password) throws java.io.IOException, PGPException, NoPrivateKeyFoundException
import java.io.*; import com.didisoft.pgp.KeyStore; public class ImportKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); InputStream keyStream = new FileInputStream("mykey.asc"); // import key keyStore.importPrivateKey(keyStream, "key password"); // the caller has to close the stream keyStream.close(); } }
privateKeyStream
- Input stream containing the key to be importedpassword
- Password of the private key
KeyPairInformation
representing the imported keys
java.io.IOException
- if an I/O error occurs (for example file not found)
PGPException
- general PGP decoding/parsing error
NoPrivateKeyFoundException
- if the supplied file does not contain private key(s)
WrongPasswordException
- if the supplied private key password is incorrectpublic java.lang.String getKeystoreFileName()
public java.lang.String getKeystorePassword()
public KeyPairInformation[] listKeys()
System.out
import com.didisoft.pgp.KeyStore; import com.didisoft.pgp.PGPLib; public class ListKeys { public static void main(String[] args) throws Exception{ KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); keyStore.listKeys(); } }
getKeys()
public KeyPairInformation getKey(java.lang.String userId)
userId
- User Id or hexadecimal Key Id of the requested key pair
public KeyPairInformation getKey(long keyId)
keyId
- Key Id of the requested key pair
public KeyPairInformation[] getKeys()
public boolean containsPublicKey(java.lang.String userId)
import com.didisoft.pgp.KeyStore; public class ContainsPublicKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); boolean keyExists = keyStore.containsPublicKey("demo@didisoft.com"); } }
userId
- User ID of the form "name (comment) <email address>"
getKeyIdForUserId(String)
public boolean containsPrivateKey(java.lang.String userId)
import com.didisoft.pgp.KeyStore; public class ContainsPrivateKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); boolean keyExists = keyStore.containsPrivateKey("demo@didisoft.com"); } }
userId
- User ID of the form "name (comment) <email address>"
getKeyIdForUserId(String)
public boolean containsKey(java.lang.String userId)
import com.didisoft.pgp.KeyStore; public class ContainsKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); boolean keyExists = keyStore.containsKey("demo@didisoft.com"); } }
userId
- User ID of the form "name (comment) <email address>"
getKeyIdForUserId(String)
public boolean containsKey(long keyId)
import com.didisoft.pgp.KeyStore; public class ContainsKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); boolean keyExists = keyStore.containsKey(keyId); } }
keyId
- Key Id of type long
getKeyIdForKeyIdHex(String)
public boolean containsPrivateKey(long keyId)
import com.didisoft.pgp.KeyStore; public class ContainsPrivateKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); boolean keyExists = keyStore.containsPrivateKey(keyId); } }
keyId
- Key Id of type long
getKeyIdForKeyIdHex(String)
public boolean containsPublicKey(long keyId)
import com.didisoft.pgp.KeyStore; public class ContainsKeyDemo { public static void main(String[] args) throws Exception{ // initialize the key store KeyStore keyStore = new KeyStore("pgp.keystore", "changeit"); long keyId = keyStore.getKeyIdForKeyIdHex("2EDE06AC"); boolean keyExists = keyStore.containsPublicKey(keyId); } }
keyId
- Key Id of type long
getKeyIdForKeyIdHex(String)
public void setAutoSave(boolean save)
KeyStore
to call save()
automatically after each
operation that modifies it (for example import key, delete key, etc.)
save
- if true
this KeyStore
instance calls automatically it's save()
method.save()
,
isAutoSave()
public boolean isAutoSave()
true
by default)
true
if auto save mode is on, otherwise false
setAutoSave(boolean)
,
save()
public boolean isBackupOnSave()
true
by default)
true
if backup file is created on save, otherwise false
setBackupOnSave(boolean)
,
save()
public void setBackupOnSave(boolean backupOnSave)
backupOnSave
- if true
a backup file (with extension .bak) is created on each call to the save()
method.isBackupOnSave()
,
save()
public void save() throws PGPException
KeyStore
instance to disk.
isAutoSave()
is true
there is no need to be called explicitly, because it is called implicitly by all
methods that change the state of this KeyStore
instance.
PGPException
- error saving the state of this key store. Use the method getUnderlyingException() to see the cause.public boolean isSkipLucasLehmerPrimeTest()
public void setSkipLucasLehmerPrimeTest(boolean skipLucasLehmerPrimeTest)
skipLucasLehmerPrimeTest
- if true the test will be skipped, otherwise it will be executed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |