Generating a pgp key from an initial private/material key

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Some library allows me to generate a pgp key pair in a such a way:



var options = 
curve: 'secp256k1',
userId: 'Hamlet <hamlet@example.net>',
passphrase: 'To be, or not to be: that is the question',
material:
key: privateKey,
subkey: privateKey

;

openpgp.generateKeyPair(options).then(function(keypair) {
// success
var privkey = keypair.privateKeyArmored;
var pubkey = keypair.publicKeyArmored;
//.........


That is, given some initial privateKey/material in addition to user_id/passphrase, it generates or perhaps converts into a pgp key.



I wonder, is there a way to do the same things with the standard gpg utility that comes with Linux? I know it accepts userId and passphrase as arguments, but does it accept as an argument something that corresponds to "material" private key in that library?



Or may there a way which include more steps to achieve the same result of generating openpg key pair?







share|improve this question




















  • What format is the existing key in? Anyway, for properly recreating an existing OpenPGP key, you must also specify the creation timestamp (it is included when calculating the key's fingerprint generally used for identification of a specific key in OpenPGP).
    – Jens Erat
    Oct 21 '17 at 7:17














up vote
0
down vote

favorite












Some library allows me to generate a pgp key pair in a such a way:



var options = 
curve: 'secp256k1',
userId: 'Hamlet <hamlet@example.net>',
passphrase: 'To be, or not to be: that is the question',
material:
key: privateKey,
subkey: privateKey

;

openpgp.generateKeyPair(options).then(function(keypair) {
// success
var privkey = keypair.privateKeyArmored;
var pubkey = keypair.publicKeyArmored;
//.........


That is, given some initial privateKey/material in addition to user_id/passphrase, it generates or perhaps converts into a pgp key.



I wonder, is there a way to do the same things with the standard gpg utility that comes with Linux? I know it accepts userId and passphrase as arguments, but does it accept as an argument something that corresponds to "material" private key in that library?



Or may there a way which include more steps to achieve the same result of generating openpg key pair?







share|improve this question




















  • What format is the existing key in? Anyway, for properly recreating an existing OpenPGP key, you must also specify the creation timestamp (it is included when calculating the key's fingerprint generally used for identification of a specific key in OpenPGP).
    – Jens Erat
    Oct 21 '17 at 7:17












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Some library allows me to generate a pgp key pair in a such a way:



var options = 
curve: 'secp256k1',
userId: 'Hamlet <hamlet@example.net>',
passphrase: 'To be, or not to be: that is the question',
material:
key: privateKey,
subkey: privateKey

;

openpgp.generateKeyPair(options).then(function(keypair) {
// success
var privkey = keypair.privateKeyArmored;
var pubkey = keypair.publicKeyArmored;
//.........


That is, given some initial privateKey/material in addition to user_id/passphrase, it generates or perhaps converts into a pgp key.



I wonder, is there a way to do the same things with the standard gpg utility that comes with Linux? I know it accepts userId and passphrase as arguments, but does it accept as an argument something that corresponds to "material" private key in that library?



Or may there a way which include more steps to achieve the same result of generating openpg key pair?







share|improve this question












Some library allows me to generate a pgp key pair in a such a way:



var options = 
curve: 'secp256k1',
userId: 'Hamlet <hamlet@example.net>',
passphrase: 'To be, or not to be: that is the question',
material:
key: privateKey,
subkey: privateKey

;

openpgp.generateKeyPair(options).then(function(keypair) {
// success
var privkey = keypair.privateKeyArmored;
var pubkey = keypair.publicKeyArmored;
//.........


That is, given some initial privateKey/material in addition to user_id/passphrase, it generates or perhaps converts into a pgp key.



I wonder, is there a way to do the same things with the standard gpg utility that comes with Linux? I know it accepts userId and passphrase as arguments, but does it accept as an argument something that corresponds to "material" private key in that library?



Or may there a way which include more steps to achieve the same result of generating openpg key pair?









share|improve this question











share|improve this question




share|improve this question










asked Oct 21 '17 at 3:27









Oari

1




1











  • What format is the existing key in? Anyway, for properly recreating an existing OpenPGP key, you must also specify the creation timestamp (it is included when calculating the key's fingerprint generally used for identification of a specific key in OpenPGP).
    – Jens Erat
    Oct 21 '17 at 7:17
















  • What format is the existing key in? Anyway, for properly recreating an existing OpenPGP key, you must also specify the creation timestamp (it is included when calculating the key's fingerprint generally used for identification of a specific key in OpenPGP).
    – Jens Erat
    Oct 21 '17 at 7:17















What format is the existing key in? Anyway, for properly recreating an existing OpenPGP key, you must also specify the creation timestamp (it is included when calculating the key's fingerprint generally used for identification of a specific key in OpenPGP).
– Jens Erat
Oct 21 '17 at 7:17




What format is the existing key in? Anyway, for properly recreating an existing OpenPGP key, you must also specify the creation timestamp (it is included when calculating the key's fingerprint generally used for identification of a specific key in OpenPGP).
– Jens Erat
Oct 21 '17 at 7:17










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Yes.



GNUPG can use an existing key. You need to activate the "expert" option in order to reveal the menu item, if you are using the interactive interface. If you are using GNUPG 2.2.1, you'll see something like this:



$gpg --expert --full-gen-key

gpg (GnuPG) 2.2.1; Copyright (C) 2017 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
(7) DSA (set your own capabilities)
(8) RSA (set your own capabilities)
(9) ECC and ECC
(10) ECC (sign only)
(11) ECC (set your own capabilities)
(13) Existing key
Your selection?


Choose option 13 to use existing PGP key material. You will need to know the keygrip of the starting key. For existing PGP keys working with GPG:



$gpg --with-keygrip --list-secret-keys [keyid]


As far as I understand it, this is a new feature so all the bugs may not be worked out yet... and probably why it's hidden in the "expert" menu. A few simple tests of mine show that it seems to work well with RSA keys, but breaks with Curve 25519 keys.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399473%2fgenerating-a-pgp-key-from-an-initial-private-material-key%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Yes.



    GNUPG can use an existing key. You need to activate the "expert" option in order to reveal the menu item, if you are using the interactive interface. If you are using GNUPG 2.2.1, you'll see something like this:



    $gpg --expert --full-gen-key

    gpg (GnuPG) 2.2.1; Copyright (C) 2017 Free Software Foundation, Inc.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Please select what kind of key you want:
    (1) RSA and RSA (default)
    (2) DSA and Elgamal
    (3) DSA (sign only)
    (4) RSA (sign only)
    (7) DSA (set your own capabilities)
    (8) RSA (set your own capabilities)
    (9) ECC and ECC
    (10) ECC (sign only)
    (11) ECC (set your own capabilities)
    (13) Existing key
    Your selection?


    Choose option 13 to use existing PGP key material. You will need to know the keygrip of the starting key. For existing PGP keys working with GPG:



    $gpg --with-keygrip --list-secret-keys [keyid]


    As far as I understand it, this is a new feature so all the bugs may not be worked out yet... and probably why it's hidden in the "expert" menu. A few simple tests of mine show that it seems to work well with RSA keys, but breaks with Curve 25519 keys.






    share|improve this answer
























      up vote
      0
      down vote













      Yes.



      GNUPG can use an existing key. You need to activate the "expert" option in order to reveal the menu item, if you are using the interactive interface. If you are using GNUPG 2.2.1, you'll see something like this:



      $gpg --expert --full-gen-key

      gpg (GnuPG) 2.2.1; Copyright (C) 2017 Free Software Foundation, Inc.
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.

      Please select what kind of key you want:
      (1) RSA and RSA (default)
      (2) DSA and Elgamal
      (3) DSA (sign only)
      (4) RSA (sign only)
      (7) DSA (set your own capabilities)
      (8) RSA (set your own capabilities)
      (9) ECC and ECC
      (10) ECC (sign only)
      (11) ECC (set your own capabilities)
      (13) Existing key
      Your selection?


      Choose option 13 to use existing PGP key material. You will need to know the keygrip of the starting key. For existing PGP keys working with GPG:



      $gpg --with-keygrip --list-secret-keys [keyid]


      As far as I understand it, this is a new feature so all the bugs may not be worked out yet... and probably why it's hidden in the "expert" menu. A few simple tests of mine show that it seems to work well with RSA keys, but breaks with Curve 25519 keys.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Yes.



        GNUPG can use an existing key. You need to activate the "expert" option in order to reveal the menu item, if you are using the interactive interface. If you are using GNUPG 2.2.1, you'll see something like this:



        $gpg --expert --full-gen-key

        gpg (GnuPG) 2.2.1; Copyright (C) 2017 Free Software Foundation, Inc.
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.

        Please select what kind of key you want:
        (1) RSA and RSA (default)
        (2) DSA and Elgamal
        (3) DSA (sign only)
        (4) RSA (sign only)
        (7) DSA (set your own capabilities)
        (8) RSA (set your own capabilities)
        (9) ECC and ECC
        (10) ECC (sign only)
        (11) ECC (set your own capabilities)
        (13) Existing key
        Your selection?


        Choose option 13 to use existing PGP key material. You will need to know the keygrip of the starting key. For existing PGP keys working with GPG:



        $gpg --with-keygrip --list-secret-keys [keyid]


        As far as I understand it, this is a new feature so all the bugs may not be worked out yet... and probably why it's hidden in the "expert" menu. A few simple tests of mine show that it seems to work well with RSA keys, but breaks with Curve 25519 keys.






        share|improve this answer












        Yes.



        GNUPG can use an existing key. You need to activate the "expert" option in order to reveal the menu item, if you are using the interactive interface. If you are using GNUPG 2.2.1, you'll see something like this:



        $gpg --expert --full-gen-key

        gpg (GnuPG) 2.2.1; Copyright (C) 2017 Free Software Foundation, Inc.
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.

        Please select what kind of key you want:
        (1) RSA and RSA (default)
        (2) DSA and Elgamal
        (3) DSA (sign only)
        (4) RSA (sign only)
        (7) DSA (set your own capabilities)
        (8) RSA (set your own capabilities)
        (9) ECC and ECC
        (10) ECC (sign only)
        (11) ECC (set your own capabilities)
        (13) Existing key
        Your selection?


        Choose option 13 to use existing PGP key material. You will need to know the keygrip of the starting key. For existing PGP keys working with GPG:



        $gpg --with-keygrip --list-secret-keys [keyid]


        As far as I understand it, this is a new feature so all the bugs may not be worked out yet... and probably why it's hidden in the "expert" menu. A few simple tests of mine show that it seems to work well with RSA keys, but breaks with Curve 25519 keys.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 23 '17 at 0:35









        RubberStamp

        1,4751216




        1,4751216



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399473%2fgenerating-a-pgp-key-from-an-initial-private-material-key%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?