All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kestra.plugin.crypto.openpgp.AbstractPgp Maven / Gradle / Ivy

There is a newer version: 0.19.0
Show newest version
package io.kestra.plugin.crypto.openpgp;

import lombok.*;
import lombok.experimental.SuperBuilder;
import name.neuhalfen.projects.crypto.bouncycastle.openpgp.keys.callbacks.KeyringConfigCallback;
import name.neuhalfen.projects.crypto.bouncycastle.openpgp.keys.callbacks.KeyringConfigCallbacks;
import io.kestra.core.exceptions.IllegalVariableEvaluationException;
import io.kestra.core.models.tasks.Task;
import io.kestra.core.runners.RunContext;

@SuperBuilder
@ToString
@EqualsAndHashCode
@Getter
@NoArgsConstructor
abstract public class AbstractPgp extends Task {
    protected static KeyringConfigCallback keyringConfig(RunContext runContext, String passphrase) throws IllegalVariableEvaluationException {
        if (passphrase != null) {
            return KeyringConfigCallbacks.withPassword(runContext.render(passphrase));
        } else {
            return KeyringConfigCallbacks.withUnprotectedKeys();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy