pgpainless/src/main/java/de/vanitasvitae/crypto/pgpainless/key/generation/KeySpec.java

37 lines
1.0 KiB
Java

package de.vanitasvitae.crypto.pgpainless.key.generation;
import de.vanitasvitae.crypto.pgpainless.key.generation.type.KeyType;
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
public class KeySpec {
private final KeyType keyType;
private final PGPSignatureSubpacketGenerator subpacketGenerator;
private final boolean inheritedSubPackets;
KeySpec(KeyType type,
PGPSignatureSubpacketGenerator subpacketGenerator,
boolean inheritedSubPackets) {
this.keyType = type;
this.subpacketGenerator = subpacketGenerator;
this.inheritedSubPackets = inheritedSubPackets;
}
KeyType getKeyType() {
return keyType;
}
PGPSignatureSubpacketVector getSubpackets() {
return subpacketGenerator.generate();
}
boolean isInheritedSubPackets() {
return inheritedSubPackets;
}
public static KeySpecBuilder getBuilder() {
return new KeySpecBuilder();
}
}