Class KeyRingBuilder

    • Constructor Detail

      • KeyRingBuilder

        public KeyRingBuilder()
    • Method Detail

      • simpleRsaKeyRing

        public PGPKeyRing simpleRsaKeyRing​(@Nonnull
                                           java.lang.String userId,
                                           @Nonnull
                                           RsaLength length)
                                    throws java.security.InvalidAlgorithmParameterException,
                                           java.security.NoSuchAlgorithmException,
                                           org.bouncycastle.openpgp.PGPException
        Creates a simple, unencrypted RSA KeyPair of length length with user-id userId. The KeyPair consists of a single RSA master key which is used for signing, encryption and certification.
        Parameters:
        userId - user id.
        length - length in bits.
        Returns:
        PGPSecretKeyRing containing the KeyPair.
        Throws:
        org.bouncycastle.openpgp.PGPException
        java.security.NoSuchAlgorithmException
        java.security.InvalidAlgorithmParameterException
      • simpleRsaKeyRing

        public PGPKeyRing simpleRsaKeyRing​(@Nonnull
                                           java.lang.String userId,
                                           @Nonnull
                                           RsaLength length,
                                           java.lang.String password)
                                    throws org.bouncycastle.openpgp.PGPException,
                                           java.security.NoSuchAlgorithmException,
                                           java.security.InvalidAlgorithmParameterException
        Creates a simple RSA KeyPair of length length with user-id userId. The KeyPair consists of a single RSA master key which is used for signing, encryption and certification.
        Parameters:
        userId - user id.
        length - length in bits.
        password - Password of the key. Can be null for unencrypted keys.
        Returns:
        PGPSecretKeyRing containing the KeyPair.
        Throws:
        org.bouncycastle.openpgp.PGPException
        java.security.NoSuchAlgorithmException
        java.security.InvalidAlgorithmParameterException
      • simpleEcKeyRing

        public PGPKeyRing simpleEcKeyRing​(@Nonnull
                                          java.lang.String userId)
                                   throws java.security.InvalidAlgorithmParameterException,
                                          java.security.NoSuchAlgorithmException,
                                          org.bouncycastle.openpgp.PGPException
        Creates an unencrypted key ring consisting of an ECDSA master key and an ECDH sub-key. The ECDSA master key is used for signing messages and certifying the sub key. The ECDH sub-key is used for encryption of messages.
        Parameters:
        userId - user-id
        Returns:
        PGPSecretKeyRing containing the key pairs.
        Throws:
        org.bouncycastle.openpgp.PGPException
        java.security.NoSuchAlgorithmException
        java.security.InvalidAlgorithmParameterException
      • simpleEcKeyRing

        public PGPKeyRing simpleEcKeyRing​(@Nonnull
                                          java.lang.String userId,
                                          java.lang.String password)
                                   throws org.bouncycastle.openpgp.PGPException,
                                          java.security.NoSuchAlgorithmException,
                                          java.security.InvalidAlgorithmParameterException
        Creates a key ring consisting of an ECDSA master key and an ECDH sub-key. The ECDSA master key is used for signing messages and certifying the sub key. The ECDH sub-key is used for encryption of messages.
        Parameters:
        userId - user-id
        password - Password of the private key. Can be null for an unencrypted key.
        Returns:
        PGPSecretKeyRing containing the key pairs.
        Throws:
        org.bouncycastle.openpgp.PGPException
        java.security.NoSuchAlgorithmException
        java.security.InvalidAlgorithmParameterException