org.rdfcontext.signing
Class PGPKeyMaster
java.lang.Object
org.rdfcontext.signing.PGPKeyMaster
- public class PGPKeyMaster
- extends java.lang.Object
This class generates a PGP key pair
- Author:
- Fabio Panaioli
|
Constructor Summary |
PGPKeyMaster(java.lang.String pgpUserId,
java.lang.String passphrase)
It generates a secret and public key ring. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PGPKeyMaster
public PGPKeyMaster(java.lang.String pgpUserId,
java.lang.String passphrase)
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
org.bouncycastle.openpgp.PGPException,
java.io.IOException
- It generates a secret and public key ring.
- Parameters:
pgpUserId - - userID of the PGP keyspassphrase - - the passphrase for to encrypt the local secret keyring
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
org.bouncycastle.openpgp.PGPException
java.io.IOException
getSecretKey
public java.io.InputStream getSecretKey(boolean armoured)
throws java.io.IOException
- Returns:
- a binary input stream rappresentation of secret key ring
- Throws:
java.io.IOException
getPublicKey
public java.io.InputStream getPublicKey(boolean armoured)
throws java.io.IOException
- Parameters:
armoured - - if true return a base 64 armoured rappresentation a binary otherwise
- Returns:
- a input stream rappresentation of public key ring
- Throws:
java.io.IOException
writeSecretToFile
public void writeSecretToFile(java.lang.String path,
boolean armoured)
throws java.io.IOException
- Parameters:
path - - the absolute path of the filearmoured - - true if you want Base64 armored objects, false otherwise
- Throws:
java.io.IOException
writePublicToFile
public void writePublicToFile(java.lang.String path,
boolean armoured)
throws java.io.IOException
- Parameters:
path - - the absolute path of the filearmoured - - true if you want Base64 armored objects, false otherwise
- Throws:
java.io.IOException