jaugment2.texteditor
Class CmdlnCrypter
java.lang.Object
|
+--jaugment2.texteditor.CmdlnCrypter
- public class CmdlnCrypter
- extends java.lang.Object
- implements TextEditorCrypter
TextEditorCrypter-implementation using a command-line-program to fo it's work
|
Method Summary |
boolean |
checksignGPG(byte[] data)
Check the GPG-signature on data |
private java.lang.String[] |
cmdlnhelper(java.lang.String format,
java.lang.String key)
|
void |
decryptGPG(java.lang.Object buffername,
byte[] indata,
byte[] pwd)
Decrypt the given bytes representing a conventional encrypted pgp-packet with the given key a new buffer with the given name |
byte[] |
encryptGPG(byte[] msg,
java.lang.String keyname,
boolean amor)
Encrypt the content of the given buffer with the given key PGP-compactible. |
byte[] |
encryptGPG(java.lang.Object buffer,
byte[] pwd)
Encrypt the content of the given buffer with the given key PGP-compactible. |
java.lang.String[] |
getGPGKeyNames(boolean onlysecretkeys)
Get the names of all GPG-keys |
byte[] |
signGPG(byte[] msg,
byte[] pwd,
java.lang.String keyname,
boolean clearsign)
Sign the content of the given buffer with the given key PGP-compactible. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
next
private TextEditorCrypter next
proxy
private TextEditorProxy proxy
cmdlnEnryptGPG
private java.lang.String cmdlnEnryptGPG
- Command-line to use when encrypting GPG/PGP-compactible
has to read the first line as the passphrase and then the message
and give the encrypted text _only_ as it's output.
cmdlnDecryptGPG
private java.lang.String cmdlnDecryptGPG
cmdlnClearSignGPG
private java.lang.String cmdlnClearSignGPG
cmdlnSignGPG
private java.lang.String cmdlnSignGPG
cmdlnListPublicKeysGPG
private java.lang.String cmdlnListPublicKeysGPG
cmdlnListSecretKeysGPG
private java.lang.String cmdlnListSecretKeysGPG
cmdlnAmorEncGPG
private java.lang.String cmdlnAmorEncGPG
cmdlnNoAmorEncGPG
private java.lang.String cmdlnNoAmorEncGPG
CmdlnCrypter
public CmdlnCrypter(TextEditorCrypter next,
TextEditorProxy proxy)
- Parameters:
next - = a next TextEditorCrypter that should be tried if we failproxy - a TextEditorProxy for the decrypt-method to add a buffer with the drcrypted text on
cmdlnhelper
private java.lang.String[] cmdlnhelper(java.lang.String format,
java.lang.String key)
encryptGPG
public byte[] encryptGPG(java.lang.Object buffer,
byte[] pwd)
- Encrypt the content of the given buffer with the given key PGP-compactible.
This function may not throw any exceptions but return null.
- Specified by:
- encryptGPG in interface TextEditorCrypter
encryptGPG
public byte[] encryptGPG(byte[] msg,
java.lang.String keyname,
boolean amor)
- Encrypt the content of the given buffer with the given key PGP-compactible.
This function may not throw any exceptions but return null.
- Specified by:
- encryptGPG in interface TextEditorCrypter
decryptGPG
public void decryptGPG(java.lang.Object buffername,
byte[] indata,
byte[] pwd)
throws java.lang.Exception
- Decrypt the given bytes representing a conventional encrypted pgp-packet with the given key a new buffer with the given name
- Specified by:
- decryptGPG in interface TextEditorCrypter
checksignGPG
public boolean checksignGPG(byte[] data)
throws java.lang.Exception
- Check the GPG-signature on data
- Specified by:
- checksignGPG in interface TextEditorCrypter
signGPG
public byte[] signGPG(byte[] msg,
byte[] pwd,
java.lang.String keyname,
boolean clearsign)
throws java.lang.Exception
- Sign the content of the given buffer with the given key PGP-compactible.
Returns the signed message with signature and amor
- Specified by:
- signGPG in interface TextEditorCrypter
getGPGKeyNames
public java.lang.String[] getGPGKeyNames(boolean onlysecretkeys)
throws java.lang.Exception
- Get the names of all GPG-keys
- Specified by:
- getGPGKeyNames in interface TextEditorCrypter