Skip to content

Commit aa4d91a

Browse files
committed
Merge branch 'documentPKTags' of https://github.com/pgpainless/bc-java into pgpainless-documentPKTags
2 parents 0a85136 + 8f5cf8f commit aa4d91a

File tree

1 file changed

+81
-13
lines changed

1 file changed

+81
-13
lines changed

pg/src/main/java/org/bouncycastle/bcpg/PublicKeyAlgorithmTags.java

Lines changed: 81 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,101 @@
11
package org.bouncycastle.bcpg;
22

33
/**
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>
512
*/
613
public interface PublicKeyAlgorithmTags
714
{
15+
/**
16+
* RSA encryption/signing algorithm.
17+
*/
818
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+
*/
924
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+
*/
1030
int RSA_SIGN = 3; // RSA Sign-Only
31+
/**
32+
* Encrypt-only ElGamal.
33+
*/
1134
int ELGAMAL_ENCRYPT = 16; // Elgamal (Encrypt-Only), see [ELGAMAL]
35+
/**
36+
* DSA.
37+
*/
1238
int DSA = 17; // DSA (Digital Signature Standard)
1339
/**
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.
1561
*/
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)
2062
int DIFFIE_HELLMAN = 21; // Reserved for Diffie-Hellman (X9.42, as defined for IETF-S/MIME)
2163
/**
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).
2371
*/
24-
int EDDSA = 22; // EdDSA - (internet draft, but appearing in use)
2572
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
3199

32100
int EXPERIMENTAL_1 = 100;
33101
int EXPERIMENTAL_2 = 101;

0 commit comments

Comments
 (0)