Sign package
This class helps signing or generating hash of a package/file.
Type | Name and description |
---|---|
static java.lang.String |
DEFAULT_HASH_ALGORITHM Constant of default hash algorithm. |
java.lang.String |
gpgKeyPassPhrase GnuPG Code Signing Key Passphrase Jenkins username/password credential |
java.lang.String |
gpgPrivateKey GnuPG Code Signing Private Key Jenkins Secret file credential |
java.lang.Object |
steps Reference to the groovy pipeline variable. |
Constructor and description |
---|
Signing
(java.lang.Object steps) Constructs the class. |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
getSigningKey(java.util.Map args = [:]) Return GnuPG signing key id |
|
java.lang.Boolean |
gpgKeyExists(java.lang.String key) Check if a GnuPG exists. |
|
java.lang.String |
hash(java.util.Map args = [:]) Generate hash file for a package |
|
java.lang.String |
hash(java.lang.String filename) Generate hash file for a package |
|
void |
init(java.util.Map args = [:]) Initialize signing properties |
|
java.lang.String |
sign(java.util.Map args = [:]) GnuPG sign a package |
|
java.lang.String |
sign(java.lang.String filename) GnuPG sign a package |
|
java.lang.Boolean |
verifySignature(java.util.Map args = [:]) Verify if the signature is good |
|
java.lang.Boolean |
verifySignature(java.lang.String filename) Verify if the signature is good |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constant of default hash algorithm.
"SHA512"
GnuPG Code Signing Key Passphrase Jenkins username/password credential
GnuPG Code Signing Private Key Jenkins Secret file credential
Reference to the groovy pipeline variable.
Constructs the class.
When invoking from a Jenkins pipeline script, the Pipeline must be passed the current environment of the Jenkinsfile to have access to the steps.
def signing = new Signing(this)
steps
- The workflow steps object provided by the Jenkins pipelineReturn GnuPG signing key id
Check if a GnuPG exists.
key
- GnuPG key to checkGenerate hash file for a package
filename
- package file will be signedalgo
- Algorithm to generate hash. Default is DEFAULT_HASH_ALGORITHM.Generate hash file for a package
Initialize signing properties
gpgKeyPassPhrase
- GnuPG Code Signing Key Passphrase Jenkins username/password credential. Default value is org.zowe.jenkins_shared_library.Constants#DEFAULT_GPG_CODE_SIGNING_KEY_PASSPHRASE.gpgPrivateKey
- GnuPG Code Signing Private Key Jenkins Secret file credential. Default value is org.zowe.jenkins_shared_library.Constants#DEFAULT_GPG_CODE_SIGNING_PRIVATE_KEY_FILE.GnuPG sign a package
filename
- package file will be signedGnuPG sign a package
Verify if the signature is good
filename
- package file will be verifiedsignature
- signature file. Optional, default will be filename with .asc extensionVerify if the signature is good
Groovy Documentation