Skip to content

generate keys using PGPainless #1055

Description

@tomholub

part of #1051

PGPainless can be used directly to generate ECC / RSA2048 / RSA 3072 / RSA 4096 keys.

        PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing()
                .withPrimaryKey(KeySpec.getBuilder(KeyType.RSA(RsaLength._3072))
                        .withKeyFlags(KeyFlag.CERTIFY_OTHER, KeyFlag.SIGN_DATA, KeyFlag.ENCRYPT_COMMS)
                        .withDefaultAlgorithms())
                .withPrimaryUserId("primary@user.id")
                .setExpirationDate(expiration)
                .withoutPassphrase()
                .build();

You can also add more user ids this way, or pass phrase. Can completely drop dependency on Node for keygen.

I imagine right now we generate first and create a pass phrase later? If so, we could instead ask for pass phrase first, then generate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions