public final class JkGpg
extends java.lang.Object
When constructing JkGpg, you can provide a secret key ring, a public key ring or both.
Modifier and Type | Method and Description |
---|---|
static java.nio.file.Path |
getDefaultPubring() |
static java.nio.file.Path |
getDefaultSecring() |
java.nio.file.Path |
getPublicRing()
Returns the public ring of this object.
|
java.nio.file.Path |
getSecretRing()
Returns the secret ring of this object.
|
static java.nio.file.Path |
getSignatureFile(java.nio.file.Path fileToSign)
Returns file that are created if a signature occurs on specified files.
|
java.util.function.UnaryOperator<java.nio.file.Path> |
getSigner(java.lang.String keyName)
Creates a signer based on this secret ring and passphrase and using the the specified key.
|
boolean |
isPublicAndSecretRingExist() |
static JkGpg |
of(java.nio.file.Path pubRing,
java.nio.file.Path secRing,
java.lang.String password)
Creates a
JkGpg with the specified public and secret ring. |
static JkGpg |
ofDefaultGnuPg()
Creates a
JkGpg with default GnuPgp file location. |
static JkGpg |
ofPublicRing(java.nio.file.Path pubRing)
Creates a JkGpg with the specified public key ring.
|
static JkGpg |
ofSecretRing(java.nio.file.Path secRing,
java.lang.String password)
Creates a JkGpg with the specified secret key ring.
|
java.nio.file.Path |
sign(java.nio.file.Path fileToSign,
java.lang.String keyname) |
void |
sign(java.nio.file.Path fileToSign,
java.lang.String keyName,
java.nio.file.Path signatureFile)
Signs the specified file and write the signature in the specified signature file.
|
boolean |
verify(java.nio.file.Path fileToVerify,
java.nio.file.Path signature)
Verifies the specified file against the specified signature.
|
JkGpg |
withPublicRing(java.nio.file.Path file)
Creates a identical
JkGpg but with the specified public ring key file. |
JkGpg |
withSecretRing(java.nio.file.Path file,
java.lang.String password)
Creates a identical
JkGpg but with the specified secret ring key file. |
JkGpg |
withSecretRingPassword(java.lang.String pwd)
Creates a identical
JkGpg but with the specified password for secret ring. |
public static JkGpg of(java.nio.file.Path pubRing, java.nio.file.Path secRing, java.lang.String password)
JkGpg
with the specified public and secret ring.public boolean isPublicAndSecretRingExist()
public static java.nio.file.Path getDefaultPubring()
public static java.nio.file.Path getDefaultSecring()
public static JkGpg ofDefaultGnuPg()
JkGpg
with default GnuPgp file location.public static JkGpg ofPublicRing(java.nio.file.Path pubRing)
public static JkGpg ofSecretRing(java.nio.file.Path secRing, java.lang.String password)
public java.nio.file.Path sign(java.nio.file.Path fileToSign, java.lang.String keyname)
public void sign(java.nio.file.Path fileToSign, java.lang.String keyName, java.nio.file.Path signatureFile)
public static java.nio.file.Path getSignatureFile(java.nio.file.Path fileToSign)
public boolean verify(java.nio.file.Path fileToVerify, java.nio.file.Path signature)
public JkGpg withSecretRing(java.nio.file.Path file, java.lang.String password)
JkGpg
but with the specified secret ring key file.public JkGpg withPublicRing(java.nio.file.Path file)
JkGpg
but with the specified public ring key file.public JkGpg withSecretRingPassword(java.lang.String pwd)
JkGpg
but with the specified password for secret ring.public java.nio.file.Path getSecretRing()
public java.nio.file.Path getPublicRing()
public java.util.function.UnaryOperator<java.nio.file.Path> getSigner(java.lang.String keyName)
keyName
- The secret key to use within the t-scrfet ring. If empty string, the first key
of the secret ring is selected.