Discuss this help topic in SecureBlackbox Forum
Add a subkey to an OpenPGP key
Creation of a new subkey for a primary key involves several steps. Note that any subkey modification involves signing by the primary key, and thus requires you to know the password for the main key.
TElPGPSecretSubkey subkey = new TElPGPSecretSubkey(); subkey .Generate(password, 1024, SB_PGP_ALGORITHM_PK_RSA_ENCRYPT, false, 0);
TElPGPSignature sig = new TElPGPSignature(); secretKey.Sign(subkey.PublicKey, sig); subkey.PublicKey.AddSignature(sig);
secretKey.AddSubkey(subkey);