|
1 | 1 | package org.bouncycastle.bcpg;
|
2 | 2 |
|
3 | 3 | /**
|
4 |
| - * Public Key Algorithm tag numbers |
| 4 | + * Public Key Algorithm IDs. |
| 5 | + * |
| 6 | + * @see <a href="RFC4880 - Public-Key Algorithms"> |
| 7 | + * https://www.rfc-editor.org/rfc/rfc4880.html#section-9.1</a> |
| 8 | + * @see <a href="LibrePGP - Public-Key Algorithms"> |
| 9 | + * https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-public-key-algorithms</a> |
| 10 | + * @see <a href="Crypto-Refresh - Public-Key Algorithms"> |
| 11 | + * https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-public-key-algorithms</a> |
5 | 12 | */
|
6 | 13 | public interface PublicKeyAlgorithmTags
|
7 | 14 | {
|
| 15 | + /** |
| 16 | + * RSA encryption/signing algorithm. |
| 17 | + */ |
8 | 18 | int RSA_GENERAL = 1; // RSA (Encrypt or Sign)
|
| 19 | + /** |
| 20 | + * Deprecated tag for encrypt-only RSA. |
| 21 | + * MUST NOT be generated. |
| 22 | + * @deprecated use {@link #RSA_GENERAL} instead. |
| 23 | + */ |
9 | 24 | int RSA_ENCRYPT = 2; // RSA Encrypt-Only
|
| 25 | + /** |
| 26 | + * Deprecated tag for sign-only RSA. |
| 27 | + * MUST NOT be generated. |
| 28 | + * @deprecated use {@link #RSA_GENERAL} instead. |
| 29 | + */ |
10 | 30 | int RSA_SIGN = 3; // RSA Sign-Only
|
| 31 | + /** |
| 32 | + * Encrypt-only ElGamal. |
| 33 | + */ |
11 | 34 | int ELGAMAL_ENCRYPT = 16; // Elgamal (Encrypt-Only), see [ELGAMAL]
|
| 35 | + /** |
| 36 | + * DSA. |
| 37 | + */ |
12 | 38 | int DSA = 17; // DSA (Digital Signature Standard)
|
13 | 39 | /**
|
14 |
| - * @deprecated use ECDH |
| 40 | + * Deprecated tag for ECDH. |
| 41 | + * @deprecated use {@link #ECDH} instead. |
| 42 | + */ |
| 43 | + int EC = 18; // Misnamed constant |
| 44 | + /** |
| 45 | + * Elliptic curve Diffie-Hellman. |
| 46 | + */ |
| 47 | + int ECDH = 18; // Elliptic Curve Diffie-Hellman |
| 48 | + /** |
| 49 | + * Elliptic curve digital signing algorithm. |
| 50 | + */ |
| 51 | + int ECDSA = 19; // Elliptic Curve Digital Signing Algorithm |
| 52 | + /** |
| 53 | + * Reserved tag for sign+encrypt ElGamal. |
| 54 | + * MUST NOT be generated. |
| 55 | + * An implementation MUST NOT generate ElGamal signatures. |
| 56 | + * @deprecated use {@link #ELGAMAL_ENCRYPT} instead. |
| 57 | + */ |
| 58 | + int ELGAMAL_GENERAL = 20; // Reserved Elgamal (Encrypt or Sign) |
| 59 | + /** |
| 60 | + * Reserved tag for IETF-style S/MIME Diffie-Hellman. |
15 | 61 | */
|
16 |
| - int EC = 18; // Reserved for Elliptic Curve |
17 |
| - int ECDH = 18; // Reserved for Elliptic Curve (actual algorithm name) |
18 |
| - int ECDSA = 19; // Reserved for ECDSA |
19 |
| - int ELGAMAL_GENERAL = 20; // Elgamal (Encrypt or Sign) |
20 | 62 | int DIFFIE_HELLMAN = 21; // Reserved for Diffie-Hellman (X9.42, as defined for IETF-S/MIME)
|
21 | 63 | /**
|
22 |
| - * @deprecated use Ed25519 or Ed448 |
| 64 | + * Misnamed tag for legacy EdDSA. |
| 65 | + * @deprecated use {@link #EDDSA_LEGACY} instead. |
| 66 | + */ |
| 67 | + int EDDSA = 22; // EdDSA - (internet draft, but appearing in use); misnamed constant |
| 68 | + /** |
| 69 | + * Legacy EdDSA (curve identified by OID). |
| 70 | + * MUST NOT be used with v6 keys (use {@link #Ed25519}, {@link #Ed448} instead). |
23 | 71 | */
|
24 |
| - int EDDSA = 22; // EdDSA - (internet draft, but appearing in use) |
25 | 72 | int EDDSA_LEGACY = 22; // new name for old EDDSA tag.
|
26 |
| - |
27 |
| - int X25519 = 25; |
28 |
| - int X448 = 26; |
29 |
| - int Ed25519 = 27; |
30 |
| - int Ed448 = 28; |
| 73 | + /** |
| 74 | + * Reserved tag for AEDH. |
| 75 | + */ |
| 76 | + int AEDH = 23; // Reserved |
| 77 | + /** |
| 78 | + * Reserved tag for AEDSA. |
| 79 | + */ |
| 80 | + int AEDSA = 24; // Reserved |
| 81 | + /** |
| 82 | + * X25519 encryption algorithm. |
| 83 | + * C-R compliant implementations MUST implement support for this. |
| 84 | + */ |
| 85 | + int X25519 = 25; // X25519 |
| 86 | + /** |
| 87 | + * X448 encryption algorithm. |
| 88 | + */ |
| 89 | + int X448 = 26; // X448 |
| 90 | + /** |
| 91 | + * Ed25519 signing algorithm. |
| 92 | + * C-R compliant implementations MUST implement support for this. |
| 93 | + */ |
| 94 | + int Ed25519 = 27; // new style Ed25519 |
| 95 | + /** |
| 96 | + * Ed448 signing algorithm. |
| 97 | + */ |
| 98 | + int Ed448 = 28; // new style Ed448 |
31 | 99 |
|
32 | 100 | int EXPERIMENTAL_1 = 100;
|
33 | 101 | int EXPERIMENTAL_2 = 101;
|
|
0 commit comments