/* globals tryTests: true */

const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');

const stub = require('sinon/lib/sinon/stub');
const chai = require('chai');
chai.use(require('chai-as-promised'));

const { expect } = chai;

const priv_key_arm2 =
  ['-----BEGIN PGP PRIVATE KEY BLOCK-----',
    'Version: GnuPG v2.0.19 (GNU/Linux)',
    '',
    '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',
    '=lw5e',
    '-----END PGP PRIVATE KEY BLOCK-----'].join('\n');

const pub_key_arm2 =
  ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
    'Version: GnuPG v2.0.19 (GNU/Linux)',
    '',
    'mI0EUmEvTgEEANyWtQQMOybQ9JltDqmaX0WnNPJeLILIM36sw6zL0nfTQ5zXSS3+',
    'fIF6P29lJFxpblWk02PSID5zX/DYU9/zjM2xPO8Oa4xo0cVTOTLj++Ri5mtr//f5',
    'GLsIXxFrBJhD/ghFsL3Op0GXOeLJ9A5bsOn8th7x6JucNKuaRB6bQbSPABEBAAG0',
    'JFRlc3QgTWNUZXN0aW5ndG9uIDx0ZXN0QGV4YW1wbGUuY29tPoi5BBMBAgAjBQJS',
    'YS9OAhsvBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQSmNhOk1uQJQwDAP6',
    'AgrTyqkRlJVqz2pb46TfbDM2TDF7o9CBnBzIGoxBhlRwpqALz7z2kxBDmwpQa+ki',
    'Bq3jZN/UosY9y8bhwMAlnrDY9jP1gdCo+H0sD48CdXybblNwaYpwqC8VSpDdTndf',
    '9j2wE/weihGp/DAdy/2kyBCaiOY1sjhUfJ1GogF49rC4jQRSYS9OAQQA6R/PtBFa',
    'JaT4jq10yqASk4sqwVMsc6HcifM5lSdxzExFP74naUMMyEsKHP53QxTF0Grqusag',
    'Qg/ZtgT0CN1HUM152y7ACOdp1giKjpMzOTQClqCoclyvWOFB+L/SwGEIJf7LSCEr',
    'woBuJifJc8xAVr0XX0JthoW+uP91eTQ3XpsAEQEAAYkBPQQYAQIACQUCUmEvTgIb',
    'LgCoCRBKY2E6TW5AlJ0gBBkBAgAGBQJSYS9OAAoJEOCE90RsICyXuqIEANmmiRCA',
    'SF7YK7PvFkieJNwzeK0V3F2lGX+uu6Y3Q/Zxdtwc4xR+me/CSBmsURyXTO29OWhP',
    'GLszPH9zSJU9BdDi6v0yNprmFPX/1Ng0Abn/sCkwetvjxC1YIvTLFwtUL/7v6NS2',
    'bZpsUxRTg9+cSrMWWSNjiY9qUKajm1tuzPDZXAUEAMNmAN3xXN/Kjyvj2OK2ck0X',
    'W748sl/tc3qiKPMJ+0AkMF7Pjhmh9nxqE9+QCEl7qinFqqBLjuzgUhBU4QlwX1GD',
    'AtNTq6ihLMD5v1d82ZC7tNatdlDMGWnIdvEMCv2GZcuIqDQ9rXWs49e7tq1NncLY',
    'hz3tYjKhoFTKEIq3y3Pp',
    '=h/aX',
    '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const pub_key_arm4 = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG 2.1.15 (GNU/Linux)

mI0EWpoNLAEEAMoO8dfnLvvCze1hjWcr8t1fMdndFQc1fAM7dm6sbqrdlaAz+Dab
zF3F9UhIOCcABRm+QHyZlgEsoQpHF/7sWflUK1FpoxdORINtIDilukUkMZ0NnIaD
+8pRutdSczPNFvSImSzZNCyLzvDCGMO3+Xeaa6pViSPEeBwhXWJUuHYtABEBAAG0
IkpvZSBVc2VyIDxqb2UudXNlckBwcm90b25tYWlsLmNvbT6ItwQTAQgAIQUCWpoN
LAIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRBYtrN4WUnCtoUjBACi6qVb
noQJ1aOaOyoBZscDIO5XZHZK4L9V9uJJhD9v1qRF5s0PRiG969EwFlvjqIlLiRej
KSxvE/1rcym4GwBUndku1fMM+weTWHNtRn9+BPzN/4eKZbUbY3fHtlk+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Zlcs760LiYUr69CninMrnbDNnAhrYAcyJS42viUADPv9g+CBbyanB4KyE4UNrZ
BCB296lOEW4v1IZVNrNvqrbka3/p0qqBJiFTh7eT3zXpRNArFZDmLCUEEm53qT1a
PO/MyYUGTTMRAzTmNTiPiJ8EGAEIAAkFAlqaDSwCGwwACgkQWLazeFlJwrZQEAQA
uUrp9Qp76CnKqUsUjcVxq7DJBi/lewyGGYSVAFt6/0Xyg/8YTEa/c4Dri/HMOtrf
bgjp/doIVaZLOXZYfqRcpy3z0M6BierOPB3D+fdaTfd7gIrQnGHIp2NmbJZnYgl8
Ps23qF+LKTa1eE+AmMQYzUHSGuka2lp6OglwWzg/dEw=
=mr3M
-----END PGP PRIVATE KEY BLOCK-----`;

const revocation_certificate_arm4 = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG 2.1.15 (GNU/Linux)
Comment: This is a revocation certificate

iJ8EIAEIAAkFAlqaDT0CHQAACgkQWLazeFlJwrbOaAP/V38FhBrUy4XYgt8ZX22G
ov6IFDNoyRKafSuz7Rg+8K8cf+0MAsSi52ueKfsbPxQ+I1vPeaEuEYbwTjtbvM+M
vZcX+VNYdsc1iZeNaT4ayA+2LrCN/xgFj0nrExHqcZAjgBZ9pvKghAqdK4Zb2Ghb
7chPiLLNWJCMtL4bo7a1X84=
=HcWg
-----END PGP PUBLIC KEY BLOCK-----`;

const revoked_key_arm4 = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG 2.1.15 (GNU/Linux)

mI0EWpoNLAEEAMoO8dfnLvvCze1hjWcr8t1fMdndFQc1fAM7dm6sbqrdlaAz+Dab
zF3F9UhIOCcABRm+QHyZlgEsoQpHF/7sWflUK1FpoxdORINtIDilukUkMZ0NnIaD
+8pRutdSczPNFvSImSzZNCyLzvDCGMO3+Xeaa6pViSPEeBwhXWJUuHYtABEBAAGI
nwQgAQgACQUCWpoNPQIdAAAKCRBYtrN4WUnCts5oA/9XfwWEGtTLhdiC3xlfbYai
/ogUM2jJEpp9K7PtGD7wrxx/7QwCxKLna54p+xs/FD4jW895oS4RhvBOO1u8z4y9
lxf5U1h2xzWJl41pPhrID7YusI3/GAWPSesTEepxkCOAFn2m8qCECp0rhlvYaFvt
yE+Iss1YkIy0vhujtrVfzrQiSm9lIFVzZXIgPGpvZS51c2VyQHByb3Rvbm1haWwu
Y29tPoi3BBMBCAAhBQJamg0sAhsDBQsJCAcCBhUICQoLAgQWAgMBAh4BAheAAAoJ
EFi2s3hZScK2hSMEAKLqpVuehAnVo5o7KgFmxwMg7ldkdkrgv1X24kmEP2/WpEXm
zQ9GIb3r0TAWW+OoiUuJF6MpLG8T/WtzKbgbAFSd2S7V8wz7B5NYc21Gf34E/M3/
h4pltRtjd8e2WT4t17c34Jm+sYpL8gK1u24B9kvQt3POqc24FReU7oSkbkLeuI0E
WpoNLAEEAMNRHMaSlOf8VNPEfKF5qL7NM5SbLs3VWIJE+QSsh4PrTq1l/+wqoCcQ
KF8QJ5klF5jJ03UHc7xA7IgvL+sfQNLZu3/qO6GSc9UYc9QDI3EeaIdhdNSAY8Rf
VB+6yPMFx8iTq8eNgGJGb8i72LCvMLDKkDh1YNlJNm4WtWx/if63ABEBAAGInwQY
AQgACQUCWpoNLAIbDAAKCRBYtrN4WUnCtlAQBAC5Sun1CnvoKcqpSxSNxXGrsMkG
L+V7DIYZhJUAW3r/RfKD/xhMRr9zgOuL8cw62t9uCOn92ghVpks5dlh+pFynLfPQ
zoGJ6s48HcP591pN93uAitCcYcinY2ZslmdiCXw+zbeoX4spNrV4T4CYxBjNQdIa
6RraWno6CXBbOD90TA==
=8d2d
-----END PGP PUBLIC KEY BLOCK-----`;

const twoKeys =
     ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
      'Version: GnuPG v2.0.19 (GNU/Linux)',
      '',
      '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',
      'PepQmgsu',
      '=w6wd',
      '-----END PGP PUBLIC KEY BLOCK-----'].join("\n");

const pub_revoked_subkeys =
    ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
    'Version: GnuPG v2.0.19 (GNU/Linux)',
    '',
    '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',
    'pMiJM+NJAQ==',
    '=ok+o',
    '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const pub_revoked_with_cert =
    ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
    'Comment: GPGTools - https://gpgtools.org',
    '',
    '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',
    'onCOcv4DKguN2w==',
    '=OqO3',
    '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const pub_sig_test =
 ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
  'Version: GnuPG v2.0.19 (GNU/Linux)',
  '',
  'mQENBFKgqXUBCADC4c6sSBnBU+15Y32/a8IXqO2WxKxSHj7I5hv1OdSTmSZes7nZ',
  '5V96qsk0k5/ka3C2In+GfTKfuAJ0oVkTZVi5tHP9D+PcZngrIFX56OZ2P5PtTU7U',
  'jh0C78JwCVnv6Eg57JnIMwdbL3ZLqmogLhw5q15Hie5btCIQnuuKfrwxnsox4i3q',
  'dYCHYB1HBGzpvflS07r3Y3IRFJaP8hUhx7PsvpD1s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RnqN',
  'LgguiQYq//N6LxF1MeQSxxmNr6kNalafp+pwRwNV4G2L7QWPYn3Axe5oEbjKfnoF',
  'pwhalEs4PCnNiQGFBBgBAgAPBQJSoKrSAhsCBQkAAVGAAGoJEMB25jTTK0mNXyAE',
  'GREIAAYFAlKgqtIACgkQqxSB4x5Bj2igHQD+JYra3ESBrVwurLq4n8mm4bq5Wujm',
  'Da5k6Vf7F7ytbDAA/jb47AhgcDXQRcMw0ElTap5AP/JgtuglW/fO4cJxJfa8Yf0H',
  '/i95k6w/MOn5CIwgpZyHc/F4bAVyaZmZ8gAT4lhn03ZDehFNrGJ0IhQH/QfqqNSp',
  'NqG8h7GQIH6ovJlLIcolszIL3khI7LhMsIS6Yi8xpPPB9QcqNmjYkuYAtPE2KyL+',
  '2yBt+f4AJ/VFnBygcUf+AC6YxBS3cYclGKUAE9j6StRGj3kPNJPF7M5dZi+1+1Tu',
  'yJ5ucX3iq+3GKLq98Lv7SPUxIqkxuZbkZIoX99Wqz8of9BUV2wTDvVXB7TEPC5Ho',
  '1y9Mb82aDrqPCq3DXvw5nz3EwxYqIXoKvLW5zsScBg9N3gmMeukXr2FCREKP5oht',
  'yeSTTh8ZnzRiwuUH1t90E7w=',
  '=e8xo',
  '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const priv_key_rsa =
  ['-----BEGIN PGP PRIVATE KEY BLOCK-----',
  'Version: GnuPG v2.0.19 (GNU/Linux)',
  '',
  'lQH+BFJhL04BBADclrUEDDsm0PSZbQ6pml9FpzTyXiyCyDN+rMOsy9J300Oc10kt',
  '/nyBej9vZSRcaW5VpNNj0iA+c1/w2FPf84zNsTzvDmuMaNHFUzky4/vkYuZra//3',
  '+Ri7CF8RawSYQ/4IRbC9zqdBlzniyfQOW7Dp/LYe8eibnDSrmkQem0G0jwARAQAB',
  '/gMDAu7L//czBpE40p1ZqO8K3k7UejemjsQqc7kOqnlDYd1Z6/3NEA/UM30Siipr',
  'KjdIFY5+hp0hcs6EiiNq0PD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',
  'qJvkeQCI6PrFM0PUIPLHAQtDJYKtaLXxYuexcAdKzZj3FHdtLNWCooK6n3vJlL1c',
  'WjZcHJ1PH7USlj1jup4XfxsbziuysRUSyXkjn92GZLm+64vCIiwhqAYoizF2NHHG',
  'hRTN4gQzxrxgkeVchl+ag7DkQUDANIIVI+A63JeLJgWJiH1fbYlwESByHW+zBFNt',
  'qStjfIOhjrfNIc3RvsggbDdWQLcbxmLZj4sB0ydPSgRKoaUdRHJY0S4vp9ouKOtl',
  '2au/P1BP3bhD0fDXl91oeheYth+MSmsJFDg/vZJzCJhFaQ9dp+2EnjN5auNCNbaI',
  'beFJRHFf9cha8p3hh+AK54NRCT++B2MXYf+TPwqX88jYMBv8kk8vYUgo8128r1zQ',
  'EzjviQE9BBgBAgAJBQJSYS9OAhsuAKgJEEpjYTpNbkCUnSAEGQECAAYFAlJhL04A',
  'CgkQ4IT3RGwgLJe6ogQA2aaJEIBIXtgrs+8WSJ4k3DN4rRXcXaUZf667pjdD9nF2',
  '3BzjFH6Z78JIGaxRHJdM7b05aE8YuzM8f3NIlT0F0OLq/TI2muYU9f/U2DQBuf+w',
  'KTB62+PELVgi9MsXC1Qv/u/o1LZtmmxTFFOD35xKsxZZI2OJj2pQpqObW27M8Nlc',
  'BQQAw2YA3fFc38qPK+PY4rZyTRdbvjyyX+1zeqIo8wn7QCQwXs+OGaH2fGoT35AI',
  'SXuqKcWqoEuO7OBSEFThCXBfUYMC01OrqKEswPm/V3zZkLu01q12UMwZach28QwK',
  '/YZly4ioND2tdazj17u2rU2dwtiHPe1iMqGgVMoQirfLc+k=',
  '=lw5e',
  '-----END PGP PRIVATE KEY BLOCK-----'].join('\n');

const user_attr_key =
  ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
  'Version: GnuPG v2.0.22 (GNU/Linux)',
  '',
  'mI0EUmEvTgEEANyWtQQMOybQ9JltDqmaX0WnNPJeLILIM36sw6zL0nfTQ5zXSS3+',
  'fIF6P29lJFxpblWk02PSID5zX/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CftAJDBez44Z',
  'ofZ8ahPfkAhJe6opxaqgS47s4FIQVOEJcF9RgwLTU6uooSzA+b9XfNmQu7TWrXZQ',
  'zBlpyHbxDAr9hmXLiKg0Pa11rOPXu7atTZ3C2Ic97WIyoaBUyhCKt8tz6Q==',
  '=MVfN',
  '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const pgp_desktop_pub =
  ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
  'Version: Encryption Desktop 10.3.0 (Build 9307)',
  '',
  'mQENBFNjoowBCACeKvpQnv8wN3UdDVrZN//Bh/Dtq60hbZ3ObfTbNVBQ0DLD6jWA',
  'lKgwgSa3GLr0a3qrc30CRq0hRIjrFMrg4aPu5sRiZYP90B1cUGf08F2by8f+as2b',
  'BOBzRkcxH/ZmBZPU0pkRoOnkMvoT+YVt2MxzaJRBKM1dgcPXTHvZ52j7V0uEJvs8',
  's/H8DJq6MtgYqoS1zt/+eqUSDCcsVJBsEl7o7qU2d9i074hiBouM2B2mimvBKFIn',
  'W2kmG6fSryNSLaUMwvOTEC/esVNlgvSBfhu82Gic8Rwc+g0cHUnAESChxz/jE0P6',
  'INt2IpBZKeuXCY97tQmce3R4GOc/r3FNBBa3ABEBAAG0HVBHUCBEZXNrdG9wIDEw',
  'LjMgPHBncEBzeW0uZGU+iQFyBBABAgBcBQJTY6KMMBSAAAAAACAAB3ByZWZlcnJl',
  'ZC1lbWFpbC1lbmNvZGluZ0BwZ3AuY29tcGdwbWltZQgLCQgHAwIBCgIZAQUbAwAA',
  'AAUWAAMCAQUeAQAAAAYVCAkKAwIACgkQjhjogWc7SuswzggAhxyEqLPiKTJdQOCj',
  'ewGX/2gyY+oreHZWVqoDU8J0AO3Ppnpv4mcyaKCqAteBzLtDj1KPxqCBF0mpYn9H',
  '4o6qPTPlOFm83tmw8O5bLeNltDjElt93sNaHtWxKWjZReDbq4ZmwbjOoYt6ms1Tm',
  'azkVeEuSTSbDPknSaNh1a9ew1gytH5MWQwovqNxU0AgAK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CBKk04n91ygTK8StOxz3WAPFawJvuLBzobHXfrCrHH',
  '6Q6gjjAiagMouX/t6bGExydrPjHFiZrcdZDFqWyEf4nr5ixLISu8vUc17eH5EZhk',
  'EI60kmrH+xgvHa8wj5V2yk855tUr27BU2TOtcMgczT7nQhM4GWvzqyQxgvfvyXmY',
  '8Lb9xUxv5RtWxkDjbbDa5dsKjquy7OPg857N8AizSsAK4Q4q9c8W5ivjYCegqv3S',
  '+ysgG+xjsUOP8UzMbS35tIlmQ8j0hO7JuY1Gm0WnPN5PIJFZjebxjQ==',
  '=dVeR',
  '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const pgp_desktop_priv =
  ['-----BEGIN PGP PRIVATE KEY BLOCK-----',
  'Version: Encryption Desktop 10.3.0 (Build 9307)',
  '',
  'lQPGBFNjoowBCACeKvpQnv8wN3UdDVrZN//Bh/Dtq60hbZ3ObfTbNVBQ0DLD6jWA',
  'lKgwgSa3GLr0a3qrc30CRq0hRIjrFMrg4aPu5sRiZYP90B1cUGf08F2by8f+as2b',
  'BOBzRkcxH/ZmBZPU0pkRoOnkMvoT+YVt2MxzaJRBKM1dgcPXTHvZ52j7V0uEJvs8',
  's/H8DJq6MtgYqoS1zt/+eqUSDCcsVJBsEl7o7qU2d9i074hiBouM2B2mimvBKFIn',
  'W2kmG6fSryNSLaUMwvOTEC/esVNlgvSBfhu82Gic8Rwc+g0cHUnAESChxz/jE0P6',
  'INt2IpBZKeuXCY97tQmce3R4GOc/r3FNBBa3ABEBAAH+CQMCnq0oXlNfXhuothLb',
  '7AD3fAc7cpnuondcU2+OdOmnkrB73Qf7iVztLXRcMdIZloSqTlAna8w2ZhmDAdId',
  'EkEO0Uj+Gf7jjC7bLPob/fOj1TMZB3EPX8xs4DhD2oBI5hPNcFrZdHY+qUh1MvMm',
  'zdKgBsnbU6nJK4MrhrJ7InPIopqbNcw3ILrJZkD7U6fhiROx0+7CQ9DSVEscTj/K',
  'u3FeGchNwY2ZmTEDrXy2ZGcQR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MbJrjby/L0OfS0lEC1gE2Nh1va',
  '5g==',
  '=63Nq',
  '-----END PGP PRIVATE KEY BLOCK-----'].join('\n');

  const rsa_ecc_pub =
  ['pub   rsa4096/C9DEDC77 2015-10-17 [expires: 2018-10-16]',
  'uid         Google Security Team <security@google.com>',
  'sub   nistp384/70C16E3C 2015-10-17 [expires: 2018-10-16]',
  'sub   rsa4096/50CB43FB 2015-10-17 [expires: 2018-10-16]',
  'sub   nistp384/102D9086 2015-10-17 [expires: 2018-10-16]',
  'sub   rsa4096/DFC40367 2015-10-17 [expires: 2018-10-16]',
  '',
  '-----BEGIN PGP PUBLIC KEY BLOCK-----',
  'Version: GnuPG v2',
  '',
  'mQINBFYiIB8BEACxs55+7GG6ONQV3UFYf36UDSVFbuvNB5V1NaEnkY0t+RVMigLR',
  'Zdl0HHsiaTKfKs4jqjLQAoR6Fcre9jlEhatotRg3AvHV1XYebxRlzdfXxyD0d6i9',
  'Quc1zbca0T8F1C5c7xfYP5g9iKWn5yFtHC3S7mLeOg7Ltx84bTo8AF7bHGA3uIQf',
  'uCtE8l6Z57HTeaf2IR/893jLOir8lvmTef83m/+e1j6ZwmKxxZO2s+aGKre6Fqsz',
  'Oo89CpWKNrdZ3IN8+Y4udZNlr7u0os7ffY0shfbLrqt+eVEu4EHfbpQTJxvalZJK',
  'tEnGtV8S7Z3dcPcimxvO7HZu7Wz8VnRzY/AZtee4fC+i2yBu1rWKgY3V1tFKdxVr',
  'KDnmS5MBgBAxv69mM3bf8QPinL4mtIQ65/Dt4ksJuysRmGwQ8LkjSLQCMMepnjBs',
  '/63wJ3e4wN1LCwnJonA2f8gZQHNeGPUhVVd/dWFDtmQaLwKFcI0GS/DiUPBIJir5',
  'DWnrEedtlcSLlwwcUglFsG4Sds/tLr+z5yE88ZrDrIlX9fb9cCAsDq7c8/NCzgvw',
  'kFez14sXgGhMz6ZfFzM49o0XwlvAeuSJRWBvnKonxM7/laqv4gK0zur3a6+D6qCN',
  'vt9iWO/YG+0Fv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0x1u4E59HcAu0naLNGd9bJMw',
  'EeiVzNNyKUihENSQh9nsPniQvXgF3pPGQ8ZpS+9R9NyYQID5t3W8UrLpguvAE2U=',
  '=Q/kB',
  '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const valid_binding_sig_among_many_expired_sigs_pub = [
  '-----BEGIN PGP PUBLIC KEY BLOCK-----',
  '',
  'mQENBFFHU9EBCAC2JjXCZOB43KUiU6V7bbMQWKFCWBmtaSTOgdEixUJKmaEyWbVd',
  'OYEx5HzyumUB0fbjPv4/sbLIddpS0WAiiC1VY8zPR+eZ7W4FhEq5qOEOX5BXt5HE',
  'B/eXJgB50B4n+/ld0+IZKJwEyTQlhQCr/HdQW9aPmroOdN6lJ7bxLmWLimZNZTeX',
  '0UdX8zD7fiocwEciFEMVRXmO2dRhJvw++yNqxEzjLdc4V62M4j1ZbxtUDEq7yiDS',
  'Xkyj0PGgnJN7ClBCHeUoLguVz9CWSXwvlcwUlq3Q1fn5mnVqGuC4a7WV540X9YUl',
  'I9PdP42sagQeoGRYBA6t/pP4shmDWekPPzOxABEBAAG0FU9wZW5QR1AgPG9wZW5A',
  'cGdwLmpzPokBTgQTAQgAOAIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgBYhBLgc',
  'q0yYY4G97CsGveVSFit0ImJRBQJZu/+XAAoJEOVSFit0ImJR5L4H/38kwavLzN1E',
  'eYeVw9qXj+sR35MYcJo97pFELYcE0bINZL/IinG4mx/HgHOIrLeCLO00L3TQetPq',
  'FNJw+5VVMurOeIgaRGptEckLH23Hr+LQKRx+fYpUiqHtaEWNMBcXUstSDN2zvrCx',
  'U1gjYn0dczlTqZLTYEnq3NuZP/fyBQQe/HvdY8TQEJ0w+DUGIt+GQuBvQmWBc60m',
  '693brCHSZSJJIl/U3Y8OP3MTees8R1vDpiSCdmKm3kyvIDkSA+nowbsjGPdK07VU',
  'hCdntlDWhYMHsudPUxFrPMF8QHo2EkIN4MfWIaVERtKIpVDNV2IgXDS8meEW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uTzxX6vKVXjJ+IEY49QQ53ZLwcvUvpDlWhiJXRJHSiSIXestsnJp2bLVbfRbi',
  'V4jPXvZrgtBjU1XfpF9Ln6KqJGIwdWuKiHKm/iAr1qWZEtgj9AdtHWjlXOf+WWno',
  'tEfaA+aJefWpDs0YVQ/7LP1N70pHj2YwmQ/Cdyr1qo6iE66UMTkiGluPpGzR5yu9',
  'lhwmDcbAPbER1lIeU1K1TTWU92XCUaVuA/fPMKISlmb7UBDKWAE7904iOYOg4xsk',
  '4z6aN5G1sT5159GF',
  '=yzZh',
  '-----END PGP PUBLIC KEY BLOCK-----'
].join('\n');

const key_without_subkey = [
  '-----BEGIN PGP PRIVATE KEY BLOCK-----',
  'Version: OpenPGP.js v2.6.2',
  'Comment: https://openpgpjs.org',
  '',
  'xcLYBFp9nCsBCACXTmLI9bJzaAanrD7r6j7gNDS7PsebJr0e182hgHVnGkr3',
  '8XCsCdWSllUNfBRln4MI8GfWVO5Bhhx5en6ntCptJVeSsohAHfBzmdoauSGW',
  'y+M+3dlSGeVqgqmDukQSxuNgKBC/ELDhKvAb8uKWnS/MUOapk/6aF8mf9Vqm',
  'eG/1RHrIvxfeOsRCEFH0OqB2tOeCWPXohxpzv2AvFxWviwzpedwNGDhN/XjZ',
  'JzI4LyBKlorHJvwe4KLKtaLuOq0jmNkT6AcsniyhvqN8QRP4OK7084Uc/7Yd',
  '6Qrcnw/6plqMB5J2PyYkB6eTptp28bwIxUGzfGQ6qfDyHHQBIbAVt3m5ABEB',
  'AAEAB/9uDdjynSvon5C/oxy9Ukvbnn2AeOCNLLdA2O07/Ijoroo7IIW4zQpo',
  'rio9PbREWqrf9KVCk9IdHORXQ88eQoDdlNzG2k8ae+xq2Ux4RZJ18eVf09P/',
  '0NA7EcElDHX5RmsahOnxX72YejfdzGQd80VSEsJENF5rTMQeMkN2dIHS3pFM',
  '9ar2nJe9dc/L9ND0P79X8twZvvfh287Tm23fs384nRedcUwELm43kNV7Us3t',
  'ub1ORmAzHhVCa8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B8RncAfSIwK4dSGVh+PD5dkc=',
  '=w6Dj',
  '-----END PGP PRIVATE KEY BLOCK-----'
].join('\n');

const multi_uid_key =
  ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
  'Version: GnuPG v1',
  '',
  'mQENBFbqatUBCADmeA9CjMfzLt3TrplzDxroVisCWO7GRErUXiozULZd5S8p/rHS',
  'kuclUsQzraSuQ+Q7RhpOWdJt9onf5ro0dCC3i+AEWBrS0nyXGAtpgxJmZ618Cwzz',
  'RKrYstce4Hsyg0NS1KCbzCxpfIbyU/GOx4AzsvP3BcbRMvJ6fvrKy6zrhyVq5to3',
  'c6MayKm3cTW0+iDvqbQCMXeKH1MgAj1eOBNrbgQZhTBMhAaIFUb5l9lXUXUmZmSj',
  'r4pjjVZjWudFswXPoVRGpCOU+ahJFZLeIca99bHOl3Hu+fEbVExHdoaVq5W9R/QJ',
  '/0bHQrd+Th8e1qpIP2/ABb6P/7SGUKw6ZUvbABEBAAG0E1Rlc3QgVXNlciA8YUBi',
  'LmNvbT6JATgEEwECACIFAlbqatUCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheA',
  'AAoJEPhuIdU05lVRgtoH/ioJdP34cHIdSu2Ofsm6FoWc/nk2QEughNn2AyaxZAKO',
  'pWy9o9/+KlVD3SoV5fzl6tCsFz1MqLFBsHSj2wKoQqkU6S9MnrG12HgnirqcjOa0',
  '1uPB0aAqF3ptNScPqcD44bZ4p58TAeU5H7UlrwPUn4gypotAnu+zocNaqe0tKWVo',
  'f+GAZG/FuXJc5OK2J6OmKIABJCuRchXbkyfsXZYE3f+1U9mLse4wHQhGRiSlgqG4',
  'CCSIjeIkqeIvLCj/qGXJGyJ0XeMwMVhajylhEtDmMRlc32Jt8btlTJzcQ/3NPuQd',
  'EryD92vGp/fXwP1/rLtD49o/0UbDeXT4KQphs2DuG/60E1Rlc3QgVXNlciA8YkBj',
  'LmNvbT6JATgEEwECACIFAlbqeUACGwMGCwkIBwMCBhUIAgkKCwQWA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VnVRfQojyaUKDEofHw',
  'YD+tjFrH9uxzUEF+0p6he6DJ5KrQuy5Zq4Yc4X2rNvtjsIzww0Byymvo6eRO0Gxk',
  'ljIYQms3pCv1ja6bLlNKpPII',
  '=qxBI',
  '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const wrong_key =
  ['-----BEGIN PGP PUBLIC KEY BLOCK-----',
  'Version: OpenPGP.js v0.9.0',
  '',
  'xk0EUlhMvAEB/2MZtCUOAYvyLFjDp3OBMGn3Ev8FwjzyPbIF0JUw+L7y2XR5',
  'RVGvbK88unV3cU/1tOYdNsXI6pSp/Ztjyv7vbBUAEQEAAc0pV2hpdGVvdXQg',
  'VXNlciA8d2hpdGVvdXQudGVzdEB0LW9ubGluZS5kZT7CXAQQAQgAEAUCUlhM',
  'vQkQ9vYOm0LN/0wAAAW4Af9C+kYW1AvNWmivdtr0M0iYCUjM9DNOQH1fcvXq',
  'IiN602mWrkd8jcEzLsW5IUNzVPLhrFIuKyBDTpLnC07Loce1',
  '=6XMW',
  '-----END PGP PUBLIC KEY BLOCK-----'].join('\n');

const expiredKey =
`-----BEGIN PGP PRIVATE KEY BLOCK-----

xcA4BAAAAAEBAgCgONc0J8rfO6cJw5YTP38x1ze2tAYIO7EcmRCNYwMkXngb
0Qdzg34Q5RW0rNiR56VB6KElPUhePRPVklLFiIvHABEBAAEAAf9qabYMzsz/
/LeRVZSsTgTljmJTdzd2ambUbpi+vt8MXJsbaWh71vjoLMWSXajaKSPDjVU5
waFNt9kLqwGGGLqpAQD5ZdMH2XzTq6GU9Ka69iZs6Pbnzwdz59Vc3i8hXlUj
zQEApHargCTsrtvSrm+hK/pN51/BHAy9lxCAw9f2etx+AeMA/RGrijkFZtYt
jeWdv/usXL3mgHvEcJv63N5zcEvDX5X4W1bND3Rlc3QxIDxhQGIuY29tPsJ7
BBABCAAvBQIAAAABBQMAAAU5BgsJBwgDAgkQzcF99nGrkAkEFQgKAgMWAgEC
GQECGwMCHgEAABAlAfwPehmLZs+gOhOTTaSslqQ50bl/REjmv42Nyr1ZBlQS
DECl1Qu4QyeXin29uEXWiekMpNlZVsEuc8icCw6ABhIZ
=/7PI
-----END PGP PRIVATE KEY BLOCK-----`;

const multipleBindingSignatures =
`-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mQINBFQNRrkBEAChLrYuYjiy1jq7smQtYPln6XGJjMiJ1PbZwGK2CKQaIW6u4EUJ
Dhy6j/vbApZUJbH0krnY3KY0wWjGkAjPa32J5uIU3ldKqcZEg4mavJlsnFqwGJtB
txsDVl+2qr6BNLXSHuv/xyDHOOwWv2Hij6uPup4demscvQzNkwL08KnjJyJj/uw4
QQgXwhYBsNeHfqJN+qLuSN1hJyzGRCXCsw/QjjCjtTqns25pFFYI5viNl5bRogDx
3/FiMKJEcs3U3Gzn4XECjolRiETmGB61VZuwFatvUqEnWsz6NjsvHYkILplpOoE0
Ittk9P9/RIoBaKpvArN0NzkPPY+/HIx6h7pEyx2/IaH7IknDNAhc3jX+dgF33+tl
h4CsiUg5ra1Jg20+FXcu8F67ie21lRWXZJ+St16o4cXlQ5JCmy4qiekpN03zGW92
Gpk6tpMdAMZIH6LQPea+Cjfbu2OMkSxokQ+7MSj7CXa/vu64qq3O1/34IC1fcnek
QxoI4ses4fnyoMWDFR6v+zsyptA4v8gZGU3OliLrgRokEJYbavtU54yDVyu5peM5
iJlriNun5YnHCm7AclmrhOuKv12VfDLO6pIsb/gDpGemjcEIVj7/WhlTxr5YglXT
LikCbEiIm2YJxw5j4Z2Tj11dXK4RpBpTqvY/MEmSLRjxsr3mlP5KFBDZBwARAQAB
tB1UaG9tYXMgR3JpZXMgPG1haWxAdGdyaWVzLmRlPohGBBMRAgAGBQJUO/8GAAoJ
ECuuPPba/7AAkpIAnjC4ApIaLN2cBV2phfqOMsjFNvrTAJ9+KDMEAGkgU2fPm5Dz
xKYsNY87g4hrBBARAgArBQJUSRZuBYMB4oUAHhpodHRwOi8vd3d3LmNhY2VydC5v
cmcvY3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MavAbH/g
bSxg6XwPPrimMDrluVoD4o3YE6OBjzpynhxRBHYAW+//VZCzJQoY+0Q6iNcWEfuH
daTsTWwIUUOfXuPimCpXbNP5RLxbnX1gs0MuDuUuBrLudZ2nqR89WVSubWdLNN64
nF6KqANK1HXr5iSRFG7eRPp4hiVDdELo3cJgR6ohFGARctwst39C95URouyCwTRj
fKYwJ50Ha/xeHlMNV8Ddnd+nOvgapxDqCKcBTUC03WRxQSfvu6nMh3KUzUfX9xPM
kCAF0pNT+JE0hdJophU0lSgvFCSHor7bigol31cavlvkswEcI7Kyufvt2W3FAma+
bJaLcqfGCCoIOdf7n4VNCfFArzXsPx2chrPRf7akO4/cumVxqcKrDZf1Gdy3cXEx
Bl7cynwaatNDnspvpJWNxJQ20vJ5ibbfPrZetowAnGV0qhKM2emQIVl4q3+UDUEb
yeHL7FBsg5GXafOTcoZ8F8qhWTjICvG1aXaI4ORO1ljA/fB0wl18ypjhaCtrI6VB
qkxuzU0slqdngdLUr1iA+A8oOIZlXkcFfHTnW36O8hZVj2vK3CU9WVsEa/gJI1p1
p92yZgB3r2+f6/GIe2+7
=jZgG
-----END PGP PUBLIC KEY BLOCK-----`;

const mergeKey1 = '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
'mQENBFtDaAIBCACX5Y/YO7CuP6PMBIJWUMXFb50cGgzzowCbhdzpYU589iz1npjR\n' +
'yBmZPmnKK4KfEMz0buY+763/LFwihbfBh5jsh3oV14rqg+P6VNLeCATuGWO/5JKy\n' +
'jRNzjmQZFLcmbStF1W3+vIvJJDibMqvjHLE33z7t17BLU/fVu4F2BuuKVsM5xm/J\n' +
'HIYFzCeWR5O8+0s6Kd1SKZwzy7ySBV0w3Pk0go076RnyKyv8vneogTubA0qSAKJx\n' +
'jm6k94wJSSt3CyH5ogcLd4wjsylA65wOPIy7ROvcg05hdWO83qto4tE8o2mpB+Wc\n' +
'MZ6gkyLZnQEvKBKlh1H2BBrnI2w4iDRVSCOVABEBAAG0J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EGE1FhByJxFDKBkaEII0KxwRVS0fAk\n' +
'M2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlq\n' +
'c3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG\n' +
'x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEB\n' +
'AQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx\n' +
'BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5\n' +
'OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaX\n' +
'mJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq\n' +
'8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iiigAooooAKKKKACiiigAooooAKKKKA\n' +
'CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\n' +
'CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\n' +
'CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\n' +
'CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKK+QPib8Tf8AhY39l/8A\n' +
'Eo/s/wCweb/y8+bv37P9hcY2e/WgDv8A/hpr/qUf/Kl/9qo/4aa/6lH/AMqX/wBq\n' +
'rwCigD6/+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/WvQK+AK+v/hl8Tf8A\n' +
'hY39qf8AEo/s/wCweV/y8+bv37/9hcY2e/WgD0CiiigAooooAKKKKACiiigAoooo\n' +
'AKKKKACiivkD4m/E3/hY39l/8Sj+z/sHm/8ALz5u/fs/2FxjZ79aAO//AOGmv+pR\n' +
'/wDKl/8AaqP+Gmv+pR/8qX/2qvAKKAPr/wCGXxN/4WN/an/Eo/s/7B5X/Lz5u/fv\n' +
'/wBhcY2e/WvQK+AK+v8A4ZfE3/hY39qf8Sj+z/sHlf8ALz5u/fv/ANhcY2e/WgD0\n' +
'CiiigAooooAKKKKACiiigAr4Ar7/AK+AKACiiigAr3/9mX/maf8At0/9rV4BXv8A\n' +
'+zL/AMzT/wBun/tagD6AooooAKKKKACiiigAooooAKKKKACiiigAr4Ar7/r4AoAK\n' +
'KKKACvf/ANmX/maf+3T/ANrV4BXv/wCzL/zNP/bp/wC1qAPoCiiigAooooAKKKKA\n' +
'CiiigArz/wCJvwy/4WN/Zf8AxN/7P+web/y7ebv37P8AbXGNnv1r0CigD4Aor7/o\n' +
'oA+QPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/Wvr+iigAooooAKKKKA\n' +
'CiiigAooooAKKKKACiiigArz/wCJvwy/4WN/Zf8AxN/7P+web/y7ebv37P8AbXGN\n' +
'nv1r0CigD4Aor7/ooA+QPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/Wv\n' +
'r+iigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\n' +
'CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\n' +
'CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\n' +
'CivP/ib8Tf8AhXP9l/8AEo/tD7f5v/Lz5WzZs/2Gznf7dK8//wCGmv8AqUf/ACpf\n' +
'/aqAPoCivn//AIaa/wCpR/8AKl/9qr6AoAKKKKACiiigAooooAKKKKACiiigAooo\n' +
'oAKKKKACiiigAooooAKKK8/+JvxN/wCFc/2X/wASj+0Pt/m/8vPlbNmz/YbOd/t0\n' +
'oA9Aor4AooA+/wCivkD4ZfE3/hXP9qf8Sj+0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BQK
YIwNQ7TNDZKUqn3BzsnuJU+xTHKx8/mg7cGo+EzBstLMz7tGQJ9GN2LwrTZj
/yA2JZk3t54Ip/eNCkg7j5OaJG9l3RaW3DKPskRFY63gnitC8QIA745VRJmw
FwmHQ0H4ZoggO26+Q77ViYn84s8gio7AWkrFlt5sWhSdkrGcy/IIeSqzq0ZU
2p7zsXR8qz85+RyTcQIAxG8mwRGHkboHVa6qKt+lAxpqCuxe/buniw0LZuzu
wJQU+E6Y0oybSAcOjleIMkxULljc3Us7a5/HDKdQi4mX6wH/bVPlW8koygus
mDVIPSP2rmjBA9YVLn5CBPG+u0oGAMY9tfJ848V22S/ZPYNZe9ksFSjEuFDL
Xnmz/O1jI3Xht6IGwsCDBBgBCgAPBQI4qDdoBQkPCZwAAhsuAKgJEFzwINOI
u4R0nSAEGQEKAAYFAjioN2gACgkQJVG+vfNJQKhK6gP+LB5qXTJKCduuqZm7
VhFvPeOu4W0pyORo29zZI0owKZnD2ZKZrZhKXZC/1+xKXi8aX4V2ygRth2P1
tGFLJRqRiA3C20NVewdI4tQtEqWWSlfNFDz4EsbNspyodQ4jPsKPk2R8pFjA
wmpXLizPg2UyPKUJ/2GnNWjleP0UNyUXgD1MkgP+IkxXTYgDF5/LrOlrq7Th
WqFqQ/prQCBy7xxNLjpVKLDxGYbXVER6p0pkD6DXlaOgSB3i32dQJnU96l44
TlUyaUK/dJP7JPbVUOFq/awSxJiCxFxF6Oarc10qQ+OG5ESdJAjpCMHGCzlb
t/ia1kMpSEiOVLlX5dfHZzhR3WNtBqU=
=C0fJ
-----END PGP PRIVATE KEY BLOCK-----`;

const key_with_authorized_revocation_key = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: OpenPGP.js VERSION
Comment: https://openpgpjs.org

xsBNBFujnwwBCADK1xX03tSCmktPDS9Ncij3O5wG+F5/5Zm7QJDc39Wt1t/K
szCSobWtm/UObQVZjsTGwg0ZUPgepgWGGDBL0dlc1NObwUiOhGYnJnd4V25P
iU5M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BAAHCwF8E
GAEIABMFAlujnwwJEFiAov0Xg3K5AhsMAACI/QgArvTcutod+7n1D8wCwM50
jo3x4KPuQw+NwbOnMbFwv0R8i8NqtSFf2bYkkZ7RLViTmphvSon4h2WgfczL
SBulZ1QZF7zCKXmXDg8/HZgRUflC1XMixpB8Hqouin5AVgMbsbHg30V2uPco
V3DeFQ8HWxQC9symaMW/20MkqNXgCjM0us7kVwTEJQqZ6KYrFVjKyprSQRyP
rfckEBuZnj91OS+kAHlZ+ScZIuV4QVF0e2U6oEuB+qFXppR030PJoO6WDOzm
67hkzfrc3VpKw/I+vVJnZb4GOhNTSpa+p8i4gTyWmrOZ0G85QoldHWlWaRBg
lbjwPj3QUTbLFvHisYzXEQ==
=aT8U
-----END PGP PUBLIC KEY BLOCK-----
`;

const key_with_revoked_third_party_cert = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org

mQENBFS2KSEBCACzz8KtwE5ualmgF+rKo8aPQ9inTQWCNzCuTs3HaSe0D5heGoSh
mJWl9B5zvXN78L3yzmtWQV92CXOkCRWezIY8y+aN+aJZ6PzPE5Yy74404v3yG9ZK
jGlAWC7Wgkx+YR2vbzj7hDqi5e6TpDGsFkH3OsI3nY7FIvXWbz9Ih4/s/nBPuF0v
sBZ0n97ItszhnrXvvrF1fQvEviB0+xF5DfUURWP45EA+NWnBl7HFzY4FeN5ImYZK
Nt6A88i9SIB3MiwRSUy1UwJjL2L8l+rLbr20JbnIUuJN3h/dY10igxyOh5gsXtr1
fabsm6s2AacrCjQqLkXSnB8Ucu+Enz5R1s0dABEBAAG0KVBhc3N3b3J0ICDDpMOE
Pz9eXjEyIDIgwrUgIDxwd2RAdGVzdC5jb20+iFoEMBEKABoFAlYvilYTHSBJY2gg
d2VpcyBlcyBuaWNodAAKCRDheQpvjBNXTQ5jAKC0AMb5Ivoy0DKNI8Hjus72ob3u
TACg32AGuCernx1Wt7/5oi4KdjxjjxeJATIEEAEIACYFAlS2KSIGCw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UveC4ivGdSo1KOq3+t95xGC7dh4U3JwPanBZ6cfBJbnSEs
QWLUAPnlfn37Ff14haRETX3ND82bkXKEGEk6O5HJ0PWuUtl+TFIkYUGh4zFOZZWq
VHwaffAHDrmTZt/pOXg9l/VFnzfxrId33Tog3Zvejm2+8d2LhSCtfdrdJ/Dx2CZM
Yzxp9Mp9
=uVX6
-----END PGP PUBLIC KEY BLOCK-----
`;

const certifying_key = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org

mQGiBEOd+/gRBACfqCfgQCmUzOr7iA1CerGVmFm8HcN+NVGSpkwF6pmPJh1XVGEA
Nz9Aok6Vx4MQ+QCKo9dTXMZWDE4W/vzaKaEmsirsxGgn7JhK0t/9VeXXieWiJirA
5iTQMsRjfnS6MLLUr56E7HmDZftiOcpJu81S943r+oeINhq37SlJM7Q47wCg8miR
egss26IZfW3RvBuNW1KEDh0D/195DH6sl+/qmgUAj3M7ai1iKOqkILdNuIkYRc18
bsBYIAOjY81guhlEabYEqv8FUKPh2A7dAe/4og89HrUsVxOKJ9EGyrcqyJj676gK
BL383t1dQvyJyWfV5z4umUMaF/xE46go3Trdyu86aJDe57B74RYbWL2aaGLtkPJ2
rHOnBACG5PmLM6EXWJQSfbRqJHlRysc3MOAXMnxu8DVz+Tm0nPcArUG+Mf3GmxT+
537nHqF2xEgVvwfkvGB51ideRRQMhHUzy583zkuPYV1cJ6ykfeA6EHzVbT4vRzO8
AW9ELBKTK9F4N4gGTOdAATcaMC0gwzCz+fofJEJqC/9CS2pYvrQlVGhvbWFzIE9i
ZXJuZMO2cmZlciA8dG9iZXJuZG9AZ214LmRlPohdBBMRAgAdBQJDnfv4BgsJCAcD
AgQVAggDBBYCAwECHgECF4AACgkQ4XkKb4wTV02nkACfWvWnRawPI9AmgXpg6jg1
/22exKkAoMJ+yFhjtuGobOrIAPcEYrwlTQXBiGsEEBECACsFAksJKNQFgwHihQAe
Gmh0dHA6Ly93d3cuY2FjZXJ0Lm9yZy9jcHMucGhwAAoJENK7DQFl0P1Y4VoAmgMc
2qWuBtOBb6Uj6DskTtXORlPgAKCB3Hqp8dJ3dbQh5m0Ebf8F3P71WrkCDQRDnfw1
EAgAkp+0jMpfKKF6Gxy63fP3tCFzn9vq3GBtbNnvp8b0dx6nf+ZxELt/q9K4Yz9g
+sXq0RFQGV+YwS2BGoogzRcT4PHmUBcEAbjZIs9lZdZDEF0/68d+32mHSkLZJxGI
ezXJK3+MpGPnCMbQ63UYpcY1BvL7Vbj6P4X75dJJReGIHQMBA0FEYB5AVm6HrWU5
eDvOZ2w8QAAUluFnD9/xNRqBpcwm5uoox7zq60W5coK6p6WX8t5+WMMrRKF2A1Ru
aTxYQKo3f8XQA4e6tEcdGFlk1K9W8Ov1xVRQa6EqQYZFesbuoo8HHuSNsJ7PQrP+
vyYcafohlO/q4QtJXoUimsrEywADBQf7BQWrEx9YlNNsUD2yuov8pYCymxfUVTzK
huxGHmNj1htXfWWScA2uqD97HOdFu5nvoL2tdaO1RQR/OXKRBcUg6FhOQqqxQSxi
Vcsoy3aofGi3CWVXgn7KlSopkhlb4ELjzt5H+BMneXdgowO4MimXAfivI7OZl2fN
ut7emyN9qaeY/e25UKmCYhmhE5hM2+lV8wEmmu/qTCPiZ2u0zH/PE9AAwRz/6X+p
gsW0WIQpI6iQSSq4KyJxebtJFmCSTFawuXB6rCGovDXo/BkRsDEj1rpZnkwKJPa0
dEhKK4EzNrUzpWHeE3gKPjFXVmcjIPWVAC3BJoJRHOHg8wqLKcX5MYhGBBgRAgAG
BQJDnfw1AAoJEOF5Cm+ME1dNChoAoMKa/qx/RKlu3iQPtN6p4NlhRA9IAJ94F/7l
cKFQz1DDfFCfVpSIJRGozQ==
=EYzO
-----END PGP PUBLIC KEY BLOCK-----
`;

function versionSpecificTests() {
  it('Preferences of generated key', function() {
    const testPref = function(key) {
      // key flags
      const keyFlags = openpgp.enums.keyFlags;
      expect(key.users[0].selfCertifications[0].keyFlags[0] & keyFlags.certify_keys).to.equal(keyFlags.certify_keys);
      expect(key.users[0].selfCertifications[0].keyFlags[0] & keyFlags.sign_data).to.equal(keyFlags.sign_data);
      expect(key.subKeys[0].bindingSignatures[0].keyFlags[0] & keyFlags.encrypt_communication).to.equal(keyFlags.encrypt_communication);
      expect(key.subKeys[0].bindingSignatures[0].keyFlags[0] & keyFlags.encrypt_storage).to.equal(keyFlags.encrypt_storage);
      const sym = openpgp.enums.symmetric;
      expect(key.users[0].selfCertifications[0].preferredSymmetricAlgorithms).to.eql([sym.aes256, sym.aes128, sym.aes192, sym.cast5, sym.tripledes]);
      if (openpgp.config.aead_protect && openpgp.config.aead_protect_version === 4) {
        const aead = openpgp.enums.aead;
        expect(key.users[0].selfCertifications[0].preferredAeadAlgorithms).to.eql([aead.eax, aead.ocb]);
      }
      const hash = openpgp.enums.hash;
      expect(key.users[0].selfCertifications[0].preferredHashAlgorithms).to.eql([hash.sha256, hash.sha512, hash.sha1]);
      const compr = openpgp.enums.compression;
      expect(key.users[0].selfCertifications[0].preferredCompressionAlgorithms).to.eql([compr.zlib, compr.zip]);
      expect(key.users[0].selfCertifications[0].features).to.eql(openpgp.config.aead_protect && openpgp.config.aead_protect_version === 4 ? [7] : [1]);
    };
    const opt = {numBits: 512, userIds: 'test <a@b.com>', passphrase: 'hello'};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(async function(key) {
      testPref(key.key);
      testPref((await openpgp.key.readArmored(key.publicKeyArmored)).keys[0]);
    });
  });

  it('Generated key is not unlocked by default', function() {
    const opt = {numBits: 512, userIds: 'test <a@b.com>', passphrase: '123'};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    let key;
    return openpgp.generateKey(opt).then(function(newKey) {
      key = newKey.key;
      return openpgp.message.fromText('hello').encrypt([key]);
    }).then(function(msg) {
      return msg.message.decrypt([key]);
    }).catch(function(err) {
      expect(err.message).to.equal('Private key is not decrypted.');
    });
  });

  it('Generate key - single userid', function() {
    const userId = { name: 'test', email: 'a@b.com', comment: 'test comment' };
    const opt = {numBits: 512, userIds: userId, passphrase: '123'};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(function(key) {
      key = key.key;
      expect(key.users.length).to.equal(1);
      expect(key.users[0].userId.userid).to.equal('test <a@b.com> (test comment)');
      expect(key.users[0].userId.name).to.equal(userId.name);
      expect(key.users[0].userId.email).to.equal(userId.email);
      expect(key.users[0].userId.comment).to.equal(userId.comment);
    });
  });

  it('Generate key - setting date to the past', function() {
    const past = new Date(0);
    const opt = {
      numBits: 512,
      userIds: { name: 'Test User', email: 'text@example.com' },
      passphrase: 'secret',
      date: past
    };
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys

    return openpgp.generateKey(opt).then(function(newKey) {
      expect(newKey.key).to.exist;
      expect(+newKey.key.getCreationTime()).to.equal(+past);
      expect(+newKey.key.subKeys[0].getCreationTime()).to.equal(+past);
      expect(+newKey.key.subKeys[0].bindingSignatures[0].created).to.equal(+past);
    });
  })

  it('Generate key - multi userid', function() {
    const userId1 = 'test <a@b.com>';
    const userId2 = 'test <b@c.com>';
    const opt = {numBits: 512, userIds: [userId1, userId2], passphrase: '123'};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(function(key) {
      key = key.key;
      expect(key.users.length).to.equal(2);
      expect(key.users[0].userId.userid).to.equal(userId1);
      expect(key.users[0].selfCertifications[0].isPrimaryUserID).to.be.true;
      expect(key.users[1].userId.userid).to.equal(userId2);
      expect(key.users[1].selfCertifications[0].isPrimaryUserID).to.be.null;
    });
  });

  it('Generate key - two subkeys with default values', function() {
    const userId = 'test <a@b.com>';
    const opt = {curve: 'curve25519', userIds: [userId], passphrase: '123', subkeys:[{},{}]};
    return openpgp.generateKey(opt).then(function(key) {
      key = key.key;
      expect(key.users.length).to.equal(1);
      expect(key.users[0].userId.userid).to.equal(userId);
      expect(key.users[0].selfCertifications[0].isPrimaryUserID).to.be.true;
      expect(key.subKeys).to.have.lengthOf(2);
      expect(key.subKeys[0].getAlgorithmInfo().algorithm).to.equal('ecdh');
      expect(key.subKeys[1].getAlgorithmInfo().algorithm).to.equal('ecdh');
    });
  });

  it('Generate key - one signing subkey', function() {
    const userId = 'test <a@b.com>';
    const opt = {curve: 'curve25519', userIds: [userId], passphrase: '123', subkeys:[{}, {sign: true}]};
    return openpgp.generateKey(opt).then(function(key) {
      key = key.key;
      expect(key.users.length).to.equal(1);
      expect(key.users[0].userId.userid).to.equal(userId);
      expect(key.users[0].selfCertifications[0].isPrimaryUserID).to.be.true;
      expect(key.subKeys).to.have.lengthOf(2);
      expect(key.subKeys[0].getAlgorithmInfo().algorithm).to.equal('ecdh');
      expect(key.subKeys[1].getAlgorithmInfo().algorithm).to.equal('eddsa');
    });
  });

  it('Generate key - override main key options for subkey', function() {
    const userId = 'test <a@b.com>';
    const opt = {numBits: 512, userIds: [userId], passphrase: '123', subkeys:[{curve: 'curve25519'}]};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(function(key) {
      key = key.key;
      expect(key.users.length).to.equal(1);
      expect(key.users[0].userId.userid).to.equal(userId);
      expect(key.users[0].selfCertifications[0].isPrimaryUserID).to.be.true;
      expect(key.getAlgorithmInfo().algorithm).to.equal('rsa_encrypt_sign');
      expect(key.subKeys[0].getAlgorithmInfo().algorithm).to.equal('ecdh');
    });
  });

  it('Encrypt key with new passphrase', async function() {
    const userId = 'test <a@b.com>';
    const opt = {numBits: 512, userIds: userId, passphrase: 'passphrase'};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    const key = (await openpgp.generateKey(opt)).key;
    const armor1 = key.armor();
    const armor2 = key.armor();
    expect(armor1).to.equal(armor2);
    expect(await key.decrypt('passphrase')).to.be.true;
    expect(key.isDecrypted()).to.be.true;
    await key.encrypt('new_passphrase');
    expect(key.isDecrypted()).to.be.false;
    await expect(key.decrypt('passphrase')).to.eventually.be.rejectedWith('Incorrect key passphrase');
    expect(key.isDecrypted()).to.be.false;
    expect(await key.decrypt('new_passphrase')).to.be.true;
    expect(key.isDecrypted()).to.be.true;
    const armor3 = key.armor();
    expect(armor3).to.not.equal(armor1);
  });

  it('Generate key - ensure keyExpirationTime works', function() {
    const expect_delta = 365 * 24 * 60 * 60;
    const userId = 'test <a@b.com>';
    const opt = {numBits: 512, userIds: userId, passphrase: '123', keyExpirationTime: expect_delta};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(async function(key) {
      key = key.key;

      const expiration = await key.getExpirationTime();
      expect(expiration).to.exist;

      const actual_delta = (new Date(expiration) - new Date()) / 1000;
      expect(Math.abs(actual_delta - expect_delta)).to.be.below(60);

      const subKeyExpiration = await key.subKeys[0].getExpirationTime(key.primaryKey);
      expect(subKeyExpiration).to.exist;

      const actual_subKeyDelta = (new Date(subKeyExpiration) - new Date()) / 1000;
      expect(Math.abs(actual_subKeyDelta - expect_delta)).to.be.below(60);
    });
  });

  it('Sign and verify key - primary user', async function() {
    let publicKey = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    const privateKey = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    await privateKey.decrypt('hello world');
    publicKey = await publicKey.signPrimaryUser([privateKey]);
    const signatures = await publicKey.verifyPrimaryUser([privateKey]);
    const publicSigningKey = await publicKey.getSigningKey();
    const privateSigningKey = await privateKey.getSigningKey();
    expect(signatures.length).to.equal(2);
    expect(signatures[0].keyid.toHex()).to.equal(publicSigningKey.getKeyId().toHex());
    expect(signatures[0].valid).to.be.null;
    expect(signatures[1].keyid.toHex()).to.equal(privateSigningKey.getKeyId().toHex());
    expect(signatures[1].valid).to.be.true;
  });

  it('Sign key and verify with wrong key - primary user', async function() {
    let publicKey = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    const privateKey = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    const wrongKey = (await openpgp.key.readArmored(wrong_key)).keys[0];
    await privateKey.decrypt('hello world');
    publicKey = await publicKey.signPrimaryUser([privateKey]);
    const signatures = await publicKey.verifyPrimaryUser([wrongKey]);
    const publicSigningKey = await publicKey.getSigningKey();
    const privateSigningKey = await privateKey.getSigningKey();
    expect(signatures.length).to.equal(2);
    expect(signatures[0].keyid.toHex()).to.equal(publicSigningKey.getKeyId().toHex());
    expect(signatures[0].valid).to.be.null;
    expect(signatures[1].keyid.toHex()).to.equal(privateSigningKey.getKeyId().toHex());
    expect(signatures[1].valid).to.be.null;
  });

  it('Sign and verify key - all users', async function() {
    let publicKey = (await openpgp.key.readArmored(multi_uid_key)).keys[0];
    const privateKey = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    await privateKey.decrypt('hello world');
    publicKey = await publicKey.signAllUsers([privateKey]);
    const signatures = await publicKey.verifyAllUsers([privateKey]);
    const publicSigningKey = await publicKey.getSigningKey();
    const privateSigningKey = await privateKey.getSigningKey();
    expect(signatures.length).to.equal(4);
    expect(signatures[0].userid).to.equal(publicKey.users[0].userId.userid);
    expect(signatures[0].keyid.toHex()).to.equal(publicSigningKey.getKeyId().toHex());
    expect(signatures[0].valid).to.be.null;
    expect(signatures[1].userid).to.equal(publicKey.users[0].userId.userid);
    expect(signatures[1].keyid.toHex()).to.equal(privateSigningKey.getKeyId().toHex());
    expect(signatures[1].valid).to.be.true;
    expect(signatures[2].userid).to.equal(publicKey.users[1].userId.userid);
    expect(signatures[2].keyid.toHex()).to.equal(publicSigningKey.getKeyId().toHex());
    expect(signatures[2].valid).to.be.null;
    expect(signatures[3].userid).to.equal(publicKey.users[1].userId.userid);
    expect(signatures[3].keyid.toHex()).to.equal(privateSigningKey.getKeyId().toHex());
    expect(signatures[3].valid).to.be.true;
  });

  it('Sign key and verify with wrong key - all users', async function() {
    let publicKey = (await openpgp.key.readArmored(multi_uid_key)).keys[0];
    const privateKey = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    const wrongKey = (await openpgp.key.readArmored(wrong_key)).keys[0];
    await privateKey.decrypt('hello world');
    publicKey = await publicKey.signAllUsers([privateKey]);
    const signatures = await publicKey.verifyAllUsers([wrongKey]);
    const publicSigningKey = await publicKey.getSigningKey();
    const privateSigningKey = await privateKey.getSigningKey();
    expect(signatures.length).to.equal(4);
    expect(signatures[0].userid).to.equal(publicKey.users[0].userId.userid);
    expect(signatures[0].keyid.toHex()).to.equal(publicSigningKey.getKeyId().toHex());
    expect(signatures[0].valid).to.be.null;
    expect(signatures[1].userid).to.equal(publicKey.users[0].userId.userid);
    expect(signatures[1].keyid.toHex()).to.equal(privateSigningKey.getKeyId().toHex());
    expect(signatures[1].valid).to.be.null;
    expect(signatures[2].userid).to.equal(publicKey.users[1].userId.userid);
    expect(signatures[2].keyid.toHex()).to.equal(publicSigningKey.getKeyId().toHex());
    expect(signatures[2].valid).to.be.null;
    expect(signatures[3].userid).to.equal(publicKey.users[1].userId.userid);
    expect(signatures[3].keyid.toHex()).to.equal(privateSigningKey.getKeyId().toHex());
    expect(signatures[3].valid).to.be.null;
  });

  it('Reformat key without passphrase', function() {
    const userId1 = 'test1 <a@b.com>';
    const userId2 = 'test2 <b@a.com>';
    const opt = {numBits: 512, userIds: userId1};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(function(key) {
      key = key.key;
      expect(key.users.length).to.equal(1);
      expect(key.users[0].userId.userid).to.equal(userId1);
      expect(key.isDecrypted()).to.be.true;
      opt.privateKey = key;
      opt.userIds = userId2;
      return openpgp.reformatKey(opt).then(function(newKey) {
        newKey = newKey.key;
        expect(newKey.users.length).to.equal(1);
        expect(newKey.users[0].userId.userid).to.equal(userId2);
        expect(newKey.isDecrypted()).to.be.true;
      });
    });
  });

  it('Reformat key with no subkey with passphrase', async function() {
    const userId = 'test1 <a@b.com>';
    const keys = (await openpgp.key.readArmored(key_without_subkey)).keys;
    const opt = {privateKey: keys[0], userIds: [userId], passphrase: "test"};
    return openpgp.reformatKey(opt).then(function(newKey) {
      newKey = newKey.key;
      expect(newKey.users.length).to.equal(1);
      expect(newKey.users[0].userId.userid).to.equal(userId);
      expect(newKey.isDecrypted()).to.be.false;
    });
  });

  it('Reformat key with two subkeys with passphrase', function() {
    const userId1 = 'test <a@b.com>';
    const userId2 = 'test <b@c.com>';
    const now = openpgp.util.normalizeDate(new Date());
    const before = openpgp.util.normalizeDate(new Date(0));
    const opt1 = {curve: 'curve25519', userIds: [userId1], date: now};
    return openpgp.generateKey(opt1).then(function(newKey) {
      newKey = newKey.key;
      expect(newKey.users[0].userId.userid).to.equal(userId1);
      expect(+newKey.getCreationTime()).to.equal(+now);
      expect(+newKey.subKeys[0].getCreationTime()).to.equal(+now);
      expect(+newKey.subKeys[0].bindingSignatures[0].created).to.equal(+now);
      const opt2 = {privateKey: newKey, userIds: [userId2], date: before};
      return openpgp.reformatKey(opt2).then(function(refKey) {
        refKey = refKey.key;
        expect(refKey.users.length).to.equal(1);
        expect(refKey.users[0].userId.userid).to.equal(userId2);
        expect(+refKey.subKeys[0].bindingSignatures[0].created).to.equal(+before);
      });
    });
  });

  it('Reformat key with no subkey without passphrase', async function() {
    const userId = 'test1 <a@b.com>';
    const keys = (await openpgp.key.readArmored(key_without_subkey)).keys;
    const opt = {privateKey: keys[0], userIds: [userId]};
    return openpgp.reformatKey(opt).then(function(newKey) {
      newKey = newKey.key;
      expect(newKey.users.length).to.equal(1);
      expect(newKey.users[0].userId.userid).to.equal(userId);
      expect(newKey.isDecrypted()).to.be.true;
      return openpgp.sign({message: openpgp.cleartext.fromText('hello'), privateKeys: newKey, armor: true}).then(async function(signed) {
        return openpgp.verify(
          {message: await openpgp.cleartext.readArmored(signed.data), publicKeys: newKey.toPublic()}
        ).then(async function(verified) {
          expect(verified.signatures[0].valid).to.be.true;
          const newSigningKey = await newKey.getSigningKey();
          expect(verified.signatures[0].keyid.toHex()).to.equal(newSigningKey.getKeyId().toHex());
          expect(verified.signatures[0].signature.packets.length).to.equal(1);
        });
      });
    });
  });

  it('Reformat and encrypt key', function() {
    const userId1 = 'test1 <a@b.com>';
    const userId2 = 'test2 <b@c.com>';
    const userId3 = 'test3 <c@d.com>';
    const opt = {numBits: 512, userIds: userId1};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(function(key) {
      key = key.key;
      opt.privateKey = key;
      opt.userIds = [userId2, userId3];
      opt.passphrase = '123';
      return openpgp.reformatKey(opt).then(async function(newKey) {
        newKey = newKey.key;
        expect(newKey.users.length).to.equal(2);
        expect(newKey.users[0].userId.userid).to.equal(userId2);
        expect(newKey.isDecrypted()).to.be.false;
        await newKey.decrypt('123');
        expect(newKey.isDecrypted()).to.be.true;
      });
    });
  });

  it('Sign and encrypt with reformatted key', function() {
    const userId1 = 'test1 <a@b.com>';
    const userId2 = 'test2 <b@a.com>';
    const opt = {numBits: 512, userIds: userId1};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(function(key) {
      key = key.key;
      opt.privateKey = key;
      opt.userIds = userId2;
      return openpgp.reformatKey(opt).then(function(newKey) {
        newKey = newKey.key;
        return openpgp.encrypt({message: openpgp.message.fromText('hello'), publicKeys: newKey.toPublic(), privateKeys: newKey, armor: true}).then(async function(encrypted) {
          return openpgp.decrypt({message: await openpgp.message.readArmored(encrypted.data), privateKeys: newKey, publicKeys: newKey.toPublic()}).then(function(decrypted) {
            expect(decrypted.data).to.equal('hello');
            expect(decrypted.signatures[0].valid).to.be.true;
          });
        });
      });
    });
  });

  it('Reject with user-friendly error when reformatting encrypted key', function() {
    const opt = {numBits: 512, userIds: 'test1 <a@b.com>', passphrase: '1234'};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(function(original) {
      return openpgp.reformatKey({privateKey: original.key, userIds: 'test2 <b@a.com>', passphrase: '1234'}).then(function() {
        throw new Error('reformatKey should result in error when key not decrypted');
      }).catch(function(error) {
        expect(error.message).to.equal('Error reformatting keypair: Key not decrypted');
      });
    });
  });

  it('Revoke generated key with revocation certificate', function() {
    const opt = {numBits: 512, userIds: 'test1 <a@b.com>', passphrase: '1234'};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(function(original) {
      return openpgp.revokeKey({key: original.key.toPublic(), revocationCertificate: original.revocationCertificate}).then(function(revKey) {
        revKey = revKey.publicKey;
        expect(revKey.revocationSignatures[0].reasonForRevocationFlag).to.equal(openpgp.enums.reasonForRevocation.no_reason);
        expect(revKey.revocationSignatures[0].reasonForRevocationString).to.equal('');
        return revKey.verifyPrimaryKey().then(function(status) {
          expect(status).to.equal(openpgp.enums.keyStatus.revoked);
        });
      });
    });
  });

  it('Revoke generated key with private key', function() {
    const opt = {numBits: 512, userIds: 'test1 <a@b.com>', passphrase: '1234'};
    if (openpgp.util.getWebCryptoAll()) { opt.numBits = 2048; } // webkit webcrypto accepts minimum 2048 bit keys
    return openpgp.generateKey(opt).then(async function(original) {
      await original.key.decrypt('1234');
      return openpgp.revokeKey({key: original.key, reasonForRevocation: {string: 'Testing key revocation'}}).then(function(revKey) {
        revKey = revKey.publicKey;
        expect(revKey.revocationSignatures[0].reasonForRevocationFlag).to.equal(openpgp.enums.reasonForRevocation.no_reason);
        expect(revKey.revocationSignatures[0].reasonForRevocationString).to.equal('Testing key revocation');
        return revKey.verifyPrimaryKey().then(function(status) {
          expect(status).to.equal(openpgp.enums.keyStatus.revoked);
        });
      });
    });
  });
}

describe('Key', function() {
  let rsaGenStub;
  let rsaGenValue = openpgp.crypto.publicKey.rsa.generate(openpgp.util.getWebCryptoAll() ? 2048 : 512, "10001");

  beforeEach(function() {
    rsaGenStub = stub(openpgp.crypto.publicKey.rsa, 'generate');
    rsaGenStub.returns(rsaGenValue);
  });

  afterEach(function() {
    rsaGenStub.restore();
  });

  describe('V4', versionSpecificTests);

  let aead_protectVal;
  let aead_protect_versionVal;
  tryTests('V5', versionSpecificTests, {
    if: !openpgp.config.saucelabs,
    beforeEach: function() {
      aead_protectVal = openpgp.config.aead_protect;
      aead_protect_versionVal = openpgp.config.aead_protect_version;
      openpgp.config.aead_protect = true;
      openpgp.config.aead_protect_version = 4;
    },
    afterEach: function() {
      openpgp.config.aead_protect = aead_protectVal;
      openpgp.config.aead_protect_version = aead_protect_versionVal;
    }
  });

  it('Parsing armored text with RSA key and ECC subkey', async function() {
    openpgp.config.tolerant = true;
    const pubKeys = await openpgp.key.readArmored(rsa_ecc_pub);
    expect(pubKeys).to.exist;
    expect(pubKeys.err).to.not.exist;
    expect(pubKeys.keys).to.have.length(1);
    expect(pubKeys.keys[0].getKeyId().toHex()).to.equal('b8e4105cc9dedc77');
  });

  it('Parsing armored text with two keys', async function() {
    const pubKeys = await openpgp.key.readArmored(twoKeys);
    expect(pubKeys).to.exist;
    expect(pubKeys.err).to.not.exist;
    expect(pubKeys.keys).to.have.length(2);
    expect(pubKeys.keys[0].getKeyId().toHex()).to.equal('4a63613a4d6e4094');
    expect(pubKeys.keys[1].getKeyId().toHex()).to.equal('dbf223e870534df4');
  });

  it('Parsing armored key with an authorized revocation key', async function() {
    const pubKeys = await openpgp.key.readArmored(key_with_authorized_revocation_key);
    expect(pubKeys).to.exist;
    expect(pubKeys.err).to.exist.and.have.length(1);
    expect(pubKeys.err[0].message).to.equal('This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.');
    expect(pubKeys.keys).to.have.length(0);
  });

  it('Parsing V5 public key packet', async function() {
    // Manually modified from https://gitlab.com/openpgp-wg/rfc4880bis/blob/00b2092/back.mkd#sample-eddsa-key
    let packetBytes = openpgp.util.hex_to_Uint8Array(`
      98 37 05 53 f3 5f 0b 16  00 00 00 2d  09 2b 06 01 04 01 da 47
      0f 01 01 07 40 3f 09 89  94 bd d9 16 ed 40 53 19
      79 34 e4 a8 7c 80 73 3a  12 80 d6 2f 80 10 99 2e
      43 ee 3b 24 06
    `.replace(/\s+/g, ''));

    let packetlist = new openpgp.packet.List();
    await packetlist.read(packetBytes);
    let key = packetlist[0];
    expect(key).to.exist;
  });

  it('Testing key ID and fingerprint for V4 keys', async function() {
    const pubKeysV4 = await openpgp.key.readArmored(twoKeys);
    expect(pubKeysV4).to.exist;
    expect(pubKeysV4.err).to.not.exist;
    expect(pubKeysV4.keys).to.have.length(2);

    const pubKeyV4 = pubKeysV4.keys[0];
    expect(pubKeyV4).to.exist;

    expect(pubKeyV4.getKeyId().toHex()).to.equal('4a63613a4d6e4094');
    expect(pubKeyV4.getFingerprint()).to.equal('f470e50dcb1ad5f1e64e08644a63613a4d6e4094');
  });

  it('Create new key ID with fromId()', async function() {
    const pubKeyV4 = (await openpgp.key.readArmored(twoKeys)).keys[0];
    const keyId = pubKeyV4.getKeyId();
    const newKeyId = keyId.constructor.fromId(keyId.toHex());
    expect(newKeyId.toHex()).to.equal(keyId.toHex());
  });

  it('Testing key method getSubkeys', async function() {
    const pubKeys = await openpgp.key.readArmored(pub_sig_test);

    expect(pubKeys).to.exist;
    expect(pubKeys.err).to.not.exist;
    expect(pubKeys.keys).to.have.length(1);

    const pubKey = pubKeys.keys[0];
    expect(pubKey).to.exist;

    const packetlist = new openpgp.packet.List();

    await packetlist.read((await openpgp.armor.decode(pub_sig_test)).data);

    const subkeys = pubKey.getSubkeys();
    expect(subkeys).to.exist;
    expect(subkeys).to.have.length(2);
    expect(subkeys[0].getKeyId().equals(packetlist[8].getKeyId())).to.be.true;
    expect(subkeys[1].getKeyId().equals(packetlist[11].getKeyId())).to.be.true;
  });

  it('Verify status of revoked primary key', async function() {
    const pubKey = (await openpgp.key.readArmored(pub_revoked_subkeys)).keys[0];
    expect(pubKey.verifyPrimaryKey()).to.eventually.equal(openpgp.enums.keyStatus.revoked);
  });

  it('Verify status of revoked subkey', async function() {
    const pubKeys = await openpgp.key.readArmored(pub_sig_test);
    expect(pubKeys).to.exist;
    expect(pubKeys.err).to.not.exist;
    expect(pubKeys.keys).to.have.length(1);

    const pubKey = pubKeys.keys[0];
    expect(pubKey).to.exist;
    expect(pubKey.subKeys).to.exist;
    expect(pubKey.subKeys).to.have.length(2);

    await expect(pubKey.subKeys[0].verify(
      pubKey.primaryKey
    )).to.eventually.equal(openpgp.enums.keyStatus.revoked);
  });

  it('Verify status of key with non-self revocation signature', async function() {
    const { keys: [pubKey] } = await openpgp.key.readArmored(key_with_revoked_third_party_cert);
    const [selfCertification] = await pubKey.verifyPrimaryUser();
    const publicSigningKey = await pubKey.getSigningKey();
    expect(selfCertification.keyid.toHex()).to.equal(publicSigningKey.getKeyId().toHex());
    expect(selfCertification.valid).to.be.true;

    const { keys: [certifyingKey] } = await openpgp.key.readArmored(certifying_key);
    const certifyingSigningKey = await certifyingKey.getSigningKey();
    const signatures = await pubKey.verifyPrimaryUser([certifyingKey]);
    expect(signatures.length).to.equal(2);
    expect(signatures[0].keyid.toHex()).to.equal(publicSigningKey.getKeyId().toHex());
    expect(signatures[0].valid).to.be.null;
    expect(signatures[1].keyid.toHex()).to.equal(certifyingSigningKey.getKeyId().toHex());
    expect(signatures[1].valid).to.be.false;

    const { user } = await pubKey.getPrimaryUser();
    expect(await user.verifyCertificate(pubKey.primaryKey, user.otherCertifications[0], [certifyingKey])).to.equal(openpgp.enums.keyStatus.revoked);
  });

  it('Evaluate key flags to find valid encryption key packet', async function() {
    const pubKeys = await openpgp.key.readArmored(pub_sig_test);
    expect(pubKeys).to.exist;
    expect(pubKeys.err).to.not.exist;
    expect(pubKeys.keys).to.have.length(1);

    const pubKey = pubKeys.keys[0];
    // remove subkeys
    pubKey.subKeys = [];
    // primary key has only key flags for signing
    const encryptionKey = await pubKey.getEncryptionKey();
    expect(encryptionKey).to.not.exist;
  });

  it('Method getExpirationTime V4 Key', async function() {
    const pubKey = (await openpgp.key.readArmored(twoKeys)).keys[1];
    expect(pubKey).to.exist;
    expect(pubKey).to.be.an.instanceof(openpgp.key.Key);
    const expirationTime = await pubKey.getExpirationTime();
    expect(expirationTime.toISOString()).to.be.equal('2018-11-26T10:58:29.000Z');
  });

  it('Method getExpirationTime expired V4 Key', async function() {
    const pubKey = (await openpgp.key.readArmored(expiredKey)).keys[0];
    expect(pubKey).to.exist;
    expect(pubKey).to.be.an.instanceof(openpgp.key.Key);
    const expirationTime = await pubKey.getExpirationTime();
    expect(expirationTime.toISOString()).to.be.equal('1970-01-01T00:22:18.000Z');
  });

  it('Method getExpirationTime V4 SubKey', async function() {
    const pubKey = (await openpgp.key.readArmored(twoKeys)).keys[1];
    expect(pubKey).to.exist;
    expect(pubKey).to.be.an.instanceof(openpgp.key.Key);
    const expirationTime = await pubKey.subKeys[0].getExpirationTime(pubKey.primaryKey);
    expect(expirationTime.toISOString()).to.be.equal('2018-11-26T10:58:29.000Z');
  });

  it('Method getExpirationTime V4 Key with capabilities', async function() {
    const pubKey = (await openpgp.key.readArmored(priv_key_2000_2008)).keys[0];
    expect(pubKey).to.exist;
    expect(pubKey).to.be.an.instanceof(openpgp.key.Key);
    const expirationTime = await pubKey.getExpirationTime();
    expect(expirationTime).to.equal(Infinity);
    const encryptExpirationTime = await pubKey.getExpirationTime('encrypt_sign');
    expect(encryptExpirationTime.toISOString()).to.equal('2008-02-12T17:12:08.000Z');
  });

  it('update() - throw error if fingerprints not equal', async function() {
    const keys = (await openpgp.key.readArmored(twoKeys)).keys;
    await expect(keys[0].update.bind(
      keys[0], keys[1]
    )()).to.be.rejectedWith('Key update method: fingerprints of keys not equal');
  });

  it('update() - merge revocation signatures', async function() {
    const source = (await openpgp.key.readArmored(pub_revoked_subkeys)).keys[0];
    const dest = (await openpgp.key.readArmored(pub_revoked_subkeys)).keys[0];
    expect(source.revocationSignatures).to.exist;
    dest.revocationSignatures = [];
    return dest.update(source).then(() => {
      expect(dest.revocationSignatures[0]).to.exist.and.be.an.instanceof(openpgp.packet.Signature);
    });
  });

  it('update() - merge user', async function() {
    const source = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    const dest = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    expect(source.users[1]).to.exist;
    dest.users.pop();
    return dest.update(source).then(() => {
      expect(dest.users[1]).to.exist;
      expect(dest.users[1].userId).to.equal(source.users[1].userId);
    });
  });

  it('update() - merge user - other and certification revocation signatures', async function() {
    const source = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    const dest = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    expect(source.users[1].otherCertifications).to.exist;
    expect(source.users[1].revocationSignatures).to.exist;
    dest.users[1].otherCertifications = [];
    dest.users[1].revocationSignatures.pop();
    return dest.update(source).then(() => {
      expect(dest.users[1].otherCertifications).to.exist.and.to.have.length(1);
      expect(dest.users[1].otherCertifications[0].signature).to.equal(source.users[1].otherCertifications[0].signature);
      expect(dest.users[1].revocationSignatures).to.exist.and.to.have.length(2);
      expect(dest.users[1].revocationSignatures[1].signature).to.equal(source.users[1].revocationSignatures[1].signature);
    });
  });

  it('update() - merge subkey', async function() {
    const source = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    const dest = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    expect(source.subKeys[1]).to.exist;
    dest.subKeys.pop();
    return dest.update(source).then(() => {
      expect(dest.subKeys[1]).to.exist;
      expect(
        dest.subKeys[1].getKeyId().toHex()
      ).to.equal(source.subKeys[1].getKeyId().toHex());
    });
  });

  it('update() - merge subkey - revocation signature', async function() {
    const source = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    const dest = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    expect(source.subKeys[0].revocationSignatures).to.exist;
    dest.subKeys[0].revocationSignatures = [];
    return dest.update(source).then(() => {
      expect(dest.subKeys[0].revocationSignatures).to.exist;
      expect(dest.subKeys[0].revocationSignatures[0].signature).to.equal(dest.subKeys[0].revocationSignatures[0].signature);
    });
  });

  it('update() - merge private key into public key', async function() {
    const source = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    const dest = (await openpgp.key.readArmored(twoKeys)).keys[0];
    expect(dest.isPublic()).to.be.true;
    return dest.update(source).then(() => {
      expect(dest.isPrivate()).to.be.true;
      return Promise.all([
        dest.verifyPrimaryKey().then(result => {
          expect(source.verifyPrimaryKey()).to.eventually.equal(result);
        }),
        dest.users[0].verify(dest.primaryKey).then(result => {
          expect(source.users[0].verify(source.primaryKey)).to.eventually.equal(result);
        }),
        dest.subKeys[0].verify(dest.primaryKey).then(result => {
          expect(source.subKeys[0].verify(source.primaryKey)).to.eventually.equal(result);
        })
      ]);
    });
  });

  it('update() - merge private key into public key - no subkeys', async function() {
    const source = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    const dest = (await openpgp.key.readArmored(twoKeys)).keys[0];
    source.subKeys = [];
    dest.subKeys = [];
    expect(dest.isPublic()).to.be.true;
    return dest.update(source).then(() => {
      expect(dest.isPrivate()).to.be.true;
      return Promise.all([
        dest.verifyPrimaryKey().then(result => {
          expect(source.verifyPrimaryKey()).to.eventually.equal(result);
        }),
        dest.users[0].verify(dest.primaryKey).then(result => {
          expect(source.users[0].verify(source.primaryKey)).to.eventually.equal(result);
        })
      ]);
    });
  });

  it('update() - merge private key into public key - mismatch throws error', async function() {
    const source = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    const dest = (await openpgp.key.readArmored(twoKeys)).keys[0];
    source.subKeys = [];
    expect(dest.subKeys).to.exist;
    expect(dest.isPublic()).to.be.true;
    await expect(dest.update.bind(dest, source)())
      .to.be.rejectedWith('Cannot update public key with private key if subkey mismatch');
  });

  it('update() - merge subkey binding signatures', async function() {
    const source = (await openpgp.key.readArmored(pgp_desktop_pub)).keys[0];
    const dest = (await openpgp.key.readArmored(pgp_desktop_priv)).keys[0];
    expect(source.subKeys[0].bindingSignatures[0]).to.exist;
    await expect(source.subKeys[0].verify(source.primaryKey))
      .to.eventually.equal(openpgp.enums.keyStatus.valid);
    expect(dest.subKeys[0].bindingSignatures[0]).to.not.exist;
    return dest.update(source).then(async () => {
      expect(dest.subKeys[0].bindingSignatures[0]).to.exist;
      await expect(dest.subKeys[0].verify(source.primaryKey))
        .to.eventually.equal(openpgp.enums.keyStatus.valid);
    });
  });

  it('revoke() - primary key', async function() {
    const privKey = (await openpgp.key.readArmored(priv_key_arm2)).keys[0];
    await privKey.decrypt('hello world');

    await privKey.revoke({
      flag: openpgp.enums.reasonForRevocation.key_retired,
      string: 'Testing key revocation'
    }).then(async revKey => {
      expect(revKey.revocationSignatures).to.exist.and.have.length(1);
      expect(revKey.revocationSignatures[0].signatureType).to.equal(openpgp.enums.signature.key_revocation);
      expect(revKey.revocationSignatures[0].reasonForRevocationFlag).to.equal(openpgp.enums.reasonForRevocation.key_retired);
      expect(revKey.revocationSignatures[0].reasonForRevocationString).to.equal('Testing key revocation');

      expect(await privKey.verifyPrimaryKey()).to.equal(openpgp.enums.keyStatus.valid);
      expect(await revKey.verifyPrimaryKey()).to.equal(openpgp.enums.keyStatus.revoked);
    });
  });

  it('revoke() - subkey', async function() {
    const pubKey = (await openpgp.key.readArmored(pub_key_arm2)).keys[0];
    const privKey = (await openpgp.key.readArmored(priv_key_arm2)).keys[0];
    await privKey.decrypt('hello world');

    const subKey = pubKey.subKeys[0];
    await subKey.revoke(privKey.primaryKey, {
      flag: openpgp.enums.reasonForRevocation.key_superseded
    }).then(async revKey => {
      expect(revKey.revocationSignatures).to.exist.and.have.length(1);
      expect(revKey.revocationSignatures[0].signatureType).to.equal(openpgp.enums.signature.subkey_revocation);
      expect(revKey.revocationSignatures[0].reasonForRevocationFlag).to.equal(openpgp.enums.reasonForRevocation.key_superseded);
      expect(revKey.revocationSignatures[0].reasonForRevocationString).to.equal('');

      expect(await subKey.verify(pubKey.primaryKey)).to.equal(openpgp.enums.keyStatus.valid);
      expect(await revKey.verify(pubKey.primaryKey)).to.equal(openpgp.enums.keyStatus.revoked);
    });
  });

  it('applyRevocationCertificate() should produce the same revoked key as GnuPG', async function() {
    const pubKey = (await openpgp.key.readArmored(pub_key_arm4)).keys[0];

    return pubKey.applyRevocationCertificate(revocation_certificate_arm4).then(async revKey => {
      expect(revKey.armor()).to.equal((await openpgp.key.readArmored(revoked_key_arm4)).keys[0].armor());
    });
  });

  it('getRevocationCertificate() should produce the same revocation certificate as GnuPG', async function() {
    const revKey = (await openpgp.key.readArmored(revoked_key_arm4)).keys[0];
    const revocationCertificate = await revKey.getRevocationCertificate();

    const input = await openpgp.armor.decode(revocation_certificate_arm4);
    const packetlist = new openpgp.packet.List();
    await packetlist.read(input.data);
    const armored = openpgp.armor.encode(openpgp.enums.armor.public_key, packetlist.write());

    expect(revocationCertificate.replace(/^Comment: .*$\r\n/mg, '')).to.equal(armored.replace(/^Comment: .*$\r\n/mg, ''));
  });

  it('getRevocationCertificate() should have an appropriate comment', async function() {
    const revKey = (await openpgp.key.readArmored(revoked_key_arm4)).keys[0];
    const revocationCertificate = await revKey.getRevocationCertificate();

    expect(revocationCertificate).to.match(/Comment: This is a revocation certificate/);
    expect(revKey.armor()).not.to.match(/Comment: This is a revocation certificate/);
  });

  it("getPreferredAlgo('symmetric') - one key - AES256", async function() {
    const key1 = (await openpgp.key.readArmored(twoKeys)).keys[0];
    const prefAlgo = await openpgp.key.getPreferredAlgo('symmetric', [key1]);
    expect(prefAlgo).to.equal(openpgp.enums.symmetric.aes256);
  });

  it("getPreferredAlgo('symmetric') - two key - AES128", async function() {
    const keys = (await openpgp.key.readArmored(twoKeys)).keys;
    const key1 = keys[0];
    const key2 = keys[1];
    const primaryUser = await key2.getPrimaryUser();
    primaryUser.selfCertification.preferredSymmetricAlgorithms = [6,7,3];
    const prefAlgo = await openpgp.key.getPreferredAlgo('symmetric', [key1, key2]);
    expect(prefAlgo).to.equal(openpgp.enums.symmetric.aes128);
  });

  it("getPreferredAlgo('symmetric') - two key - one without pref", async function() {
    const keys = (await openpgp.key.readArmored(twoKeys)).keys;
    const key1 = keys[0];
    const key2 = keys[1];
    const primaryUser = await key2.getPrimaryUser();
    primaryUser.selfCertification.preferredSymmetricAlgorithms = null;
    const prefAlgo = await openpgp.key.getPreferredAlgo('symmetric', [key1, key2]);
    expect(prefAlgo).to.equal(openpgp.config.encryption_cipher);
  });

  it("getPreferredAlgo('aead') - one key - OCB", async function() {
    const key1 = (await openpgp.key.readArmored(twoKeys)).keys[0];
    const primaryUser = await key1.getPrimaryUser();
    primaryUser.selfCertification.features = [7]; // Monkey-patch AEAD feature flag
    primaryUser.selfCertification.preferredAeadAlgorithms = [2,1];
    const prefAlgo = await openpgp.key.getPreferredAlgo('aead', [key1]);
    expect(prefAlgo).to.equal(openpgp.enums.aead.ocb);
    const supported = await openpgp.key.isAeadSupported([key1]);
    expect(supported).to.be.true;
  });

  it("getPreferredAlgo('aead') - two key - one without pref", async function() {
    const keys = (await openpgp.key.readArmored(twoKeys)).keys;
    const key1 = keys[0];
    const key2 = keys[1];
    const primaryUser = await key1.getPrimaryUser();
    primaryUser.selfCertification.features = [7]; // Monkey-patch AEAD feature flag
    primaryUser.selfCertification.preferredAeadAlgorithms = [2,1];
    const primaryUser2 = await key2.getPrimaryUser();
    primaryUser2.selfCertification.features = [7]; // Monkey-patch AEAD feature flag
    const prefAlgo = await openpgp.key.getPreferredAlgo('aead', [key1, key2]);
    expect(prefAlgo).to.equal(openpgp.config.aead_mode);
    const supported = await openpgp.key.isAeadSupported([key1, key2]);
    expect(supported).to.be.true;
  });

  it("getPreferredAlgo('aead') - two key - one with no support", async function() {
    const keys = (await openpgp.key.readArmored(twoKeys)).keys;
    const key1 = keys[0];
    const key2 = keys[1];
    const primaryUser = await key1.getPrimaryUser();
    primaryUser.selfCertification.features = [7]; // Monkey-patch AEAD feature flag
    primaryUser.selfCertification.preferredAeadAlgorithms = [2,1];
    const prefAlgo = await openpgp.key.getPreferredAlgo('aead', [key1, key2]);
    expect(prefAlgo).to.equal(openpgp.config.aead_mode);
    const supported = await openpgp.key.isAeadSupported([key1, key2]);
    expect(supported).to.be.false;
  });

  it('User attribute packet read & write', async function() {
    const key = (await openpgp.key.readArmored(user_attr_key)).keys[0];
    const key2 = (await openpgp.key.readArmored(key.armor())).keys[0];
    expect(key.users[1].userAttribute).eql(key2.users[1].userAttribute);
  });

  it('getPrimaryUser()', async function() {
    const key = (await openpgp.key.readArmored(pub_sig_test)).keys[0];
    const primUser = await key.getPrimaryUser();
    expect(primUser).to.exist;
    expect(primUser.user.userId.userid).to.equal('Signature Test <signature@test.com>');
    expect(primUser.user.userId.name).to.equal('Signature Test');
    expect(primUser.user.userId.email).to.equal('signature@test.com');
    expect(primUser.user.userId.comment).to.equal('');
    expect(primUser.selfCertification).to.be.an.instanceof(openpgp.packet.Signature);
  });

  it('getPrimaryUser() should return null if no UserIDs are bound', async function() {
    const keyWithoutUserID = `-----BEGIN PGP PRIVATE KEY BLOCK-----

xVgEWxpFkRYJKwYBBAHaRw8BAQdAYjjZLkp4qG7KAqJeVQlxQT6uCPq6rylV02nC
c6D/a8YAAP0YtS4UeLzeJGSgjGTlvSd3TWEsjxdGyzwfHCOejXMRbg2+zSFVbmJv
dW5kIFVJRCA8dW5ib3VuZEBleGFtcGxlLm9yZz7HXQRbGkWREgorBgEEAZdVAQUB
AQdAfxbFuoNlm5KfoqaWICETfMljzVTDAtiSM0TYSHzGAz8DAQoJAAD/cuu7bxUE
goBAhIyVH+pmvWpuDJbfu1Vaj5KiQxsKxJgP/MJ+BBgWCgAwApsMBYJbGkWRBYkB
3+IAFqEE30YL4fxJBMTm8ONLPOiTkVxEIS8JkDzok5FcRCEvAABb+gEAnQb/rMLO
Vz/bMCJoAShgybW1r6kRWejybzIjFSLnx/YA/iLZeo5UNdlXRJco+15RbFiNSAbw
VYGdb3eNlV8CfoEC
=FYbP
-----END PGP PRIVATE KEY BLOCK-----`;
    const key = (await openpgp.key.readArmored(keyWithoutUserID)).keys[0];
    const primUser = await key.getPrimaryUser();
    expect(primUser).to.be.null;
  });

  it('Encrypt - latest created user', async function() {
    let publicKey = (await openpgp.key.readArmored(multi_uid_key)).keys[0];
    const privateKey = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    await privateKey.decrypt('hello world');
    // Set second user to prefer aes128. We should select this user by default, since it was created later.
    publicKey.users[1].selfCertifications[0].preferredSymmetricAlgorithms = [openpgp.enums.symmetric.aes128];
    const encrypted = await openpgp.encrypt({message: openpgp.message.fromText('hello'), publicKeys: publicKey, privateKeys: privateKey, armor: false});
    expect(encrypted.message.packets[0].sessionKeyAlgorithm).to.equal('aes128');
  });

  it('Encrypt - primary user', async function() {
    let publicKey = (await openpgp.key.readArmored(multi_uid_key)).keys[0];
    const privateKey = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    await privateKey.decrypt('hello world');
    // Set first user to primary. We should select this user by default.
    publicKey.users[0].selfCertifications[0].isPrimaryUserID = true;
    // Set first user to prefer aes128.
    publicKey.users[0].selfCertifications[0].preferredSymmetricAlgorithms = [openpgp.enums.symmetric.aes128];
    const encrypted = await openpgp.encrypt({message: openpgp.message.fromText('hello'), publicKeys: publicKey, privateKeys: privateKey, armor: false});
    expect(encrypted.message.packets[0].sessionKeyAlgorithm).to.equal('aes128');
  });

  it('Encrypt - specific user', async function() {
    let publicKey = (await openpgp.key.readArmored(multi_uid_key)).keys[0];
    const privateKey = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    await privateKey.decrypt('hello world');
    // Set first user to primary. We won't select this user, this is to test that.
    publicKey.users[0].selfCertifications[0].isPrimaryUserID = true;
    // Set second user to prefer aes128. We will select this user.
    publicKey.users[1].selfCertifications[0].preferredSymmetricAlgorithms = [openpgp.enums.symmetric.aes128];
    const encrypted = await openpgp.encrypt({message: openpgp.message.fromText('hello'), publicKeys: publicKey, privateKeys: privateKey, toUserId: {name: 'Test User', email: 'b@c.com'}, armor: false});
    expect(encrypted.message.packets[0].sessionKeyAlgorithm).to.equal('aes128');
    await expect(openpgp.encrypt({message: openpgp.message.fromText('hello'), publicKeys: publicKey, privateKeys: privateKey, toUserId: {name: 'Test User', email: 'c@c.com'}, armor: false})).to.be.rejectedWith('Could not find user that matches that user ID');
  });

  it('Sign - specific user', async function() {
    let publicKey = (await openpgp.key.readArmored(multi_uid_key)).keys[0];
    const privateKey = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    await privateKey.decrypt('hello world');
    const privateKeyClone = (await openpgp.key.readArmored(priv_key_rsa)).keys[0];
    // Duplicate user
    privateKey.users.push(privateKeyClone.users[0]);
    // Set first user to primary. We won't select this user, this is to test that.
    privateKey.users[0].selfCertifications[0].isPrimaryUserID = true;
    // Change userid of the first user so that we don't select it. This also makes this user invalid.
    privateKey.users[0].userId.parse('Test User <b@c.com>');
    // Set second user to prefer aes128. We will select this user.
    privateKey.users[1].selfCertifications[0].preferredHashAlgorithms = [openpgp.enums.hash.sha512];
    const signed = await openpgp.sign({message: openpgp.cleartext.fromText('hello'), privateKeys: privateKey, fromUserId: {name: 'Test McTestington', email: 'test@example.com'}, armor: false});
    expect(signed.message.signature.packets[0].hashAlgorithm).to.equal(openpgp.enums.hash.sha512);
    const encrypted = await openpgp.encrypt({message: openpgp.message.fromText('hello'), publicKeys: publicKey, privateKeys: privateKey, fromUserId: {name: 'Test McTestington', email: 'test@example.com'}, detached: true, armor: false});
    expect(encrypted.signature.packets[0].hashAlgorithm).to.equal(openpgp.enums.hash.sha512);
    await expect(openpgp.encrypt({message: openpgp.message.fromText('hello'), publicKeys: publicKey, privateKeys: privateKey, fromUserId: {name: 'Not Test McTestington', email: 'test@example.com'}, detached: true, armor: false})).to.be.rejectedWith('Could not find user that matches that user ID');
  });

  it('Find a valid subkey binding signature among many invalid ones', async function() {
    const key = (await openpgp.key.readArmored(valid_binding_sig_among_many_expired_sigs_pub)).keys[0];
    expect(await key.getEncryptionKey()).to.not.be.null;
  });

  it('Selects the most recent subkey binding signature', async function() {
    const key = (await openpgp.key.readArmored(multipleBindingSignatures)).keys[0];
    expect((await key.subKeys[0].getExpirationTime(key.primaryKey)).toISOString()).to.equal('2015-10-18T07:41:30.000Z');
  });

  it('Selects the most recent non-expired subkey binding signature', async function() {
    const key = (await openpgp.key.readArmored(multipleBindingSignatures)).keys[0];
    key.subKeys[0].bindingSignatures[1].signatureNeverExpires = false;
    key.subKeys[0].bindingSignatures[1].signatureExpirationTime = 0;
    expect((await key.subKeys[0].getExpirationTime(key.primaryKey)).toISOString()).to.equal('2018-09-07T06:03:37.000Z');
  });

  it('Selects the most recent valid subkey binding signature', async function() {
    const key = (await openpgp.key.readArmored(multipleBindingSignatures)).keys[0];
    key.subKeys[0].bindingSignatures[1].signatureData[0]++;
    expect((await key.subKeys[0].getExpirationTime(key.primaryKey)).toISOString()).to.equal('2018-09-07T06:03:37.000Z');
  });

  it('Handles a key with no valid subkey binding signatures gracefully', async function() {
    const key = (await openpgp.key.readArmored(multipleBindingSignatures)).keys[0];
    key.subKeys[0].bindingSignatures[0].signatureData[0]++;
    key.subKeys[0].bindingSignatures[1].signatureData[0]++;
    expect(await key.subKeys[0].getExpirationTime(key.primaryKey)).to.be.null;
  });

  it('Reject encryption with revoked subkey', async function() {
    const key = (await openpgp.key.readArmored(pub_revoked_subkeys)).keys[0];
    return openpgp.encrypt({publicKeys: [key], message: openpgp.message.fromText('random data')}).then(() => {
      throw new Error('encryptSessionKey should not encrypt with revoked public key');
    }).catch(function(error) {
      expect(error.message).to.equal('Error encrypting message: Could not find valid key packet for encryption in key ' + key.getKeyId().toHex());
    });
  });

  it('Reject encryption with key revoked with appended revocation cert', async function() {
    const key = (await openpgp.key.readArmored(pub_revoked_with_cert)).keys[0];
    return openpgp.encrypt({publicKeys: [key], message: openpgp.message.fromText('random data')}).then(() => {
      throw new Error('encryptSessionKey should not encrypt with revoked public key');
    }).catch(function(error) {
      expect(error.message).to.equal('Error encrypting message: Could not find valid key packet for encryption in key ' + key.getKeyId().toHex());
    });
  });

  it('Merge key with another key with non-ID user attributes', async function() {
    const key = (await openpgp.key.readArmored(mergeKey1)).keys[0];
    const updateKey = (await openpgp.key.readArmored(mergeKey2)).keys[0];
    expect(key).to.exist;
    expect(updateKey).to.exist;
    expect(key.users).to.have.length(1);
    return key.update(updateKey).then(() => {
      expect(key.getFingerprint()).to.equal(
        updateKey.getFingerprint());
      expect(key.users).to.have.length(2);
      expect(key.users[1].userId).to.be.null;
    });
  });
});
