Skip to content

Commit ca40bd6

Browse files
committed
Add documentation to individual PK algorithm tags
1 parent 87ed633 commit ca40bd6

File tree

1 file changed

+62
-12
lines changed

1 file changed

+62
-12
lines changed

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

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,79 @@
1212
*/
1313
public interface PublicKeyAlgorithmTags
1414
{
15+
/**
16+
* RSA encryption/signing algorithm.
17+
*/
1518
int RSA_GENERAL = 1; // RSA (Encrypt or Sign)
19+
/**
20+
* Deprecated tag for encrypt-only RSA.
21+
* MUST NOT be generated.
22+
*/
1623
int RSA_ENCRYPT = 2; // RSA Encrypt-Only
24+
/**
25+
* Deprecated tag for sign-only RSA.
26+
* MUST NOT be generated.
27+
*/
1728
int RSA_SIGN = 3; // RSA Sign-Only
29+
/**
30+
* Encrypt-only ElGamal.
31+
*/
1832
int ELGAMAL_ENCRYPT = 16; // Elgamal (Encrypt-Only), see [ELGAMAL]
33+
/**
34+
* DSA.
35+
*/
1936
int DSA = 17; // DSA (Digital Signature Standard)
2037
/**
21-
* @deprecated use ECDH
38+
* Deprecated tag for ECDH.
39+
* @deprecated use {@link #ECDH} instead.
40+
*/
41+
int EC = 18; // Misnamed constant
42+
/**
43+
* Elliptic curve Diffie-Hellman.
44+
*/
45+
int ECDH = 18; // Elliptic Curve Diffie-Hellman
46+
/**
47+
* Elliptic curve digital signing algorithm.
48+
*/
49+
int ECDSA = 19; // Elliptic Curve Digital Signing Algorithm
50+
/**
51+
* Reserved tag for sign+encrypt ElGamal.
52+
* MUST NOT be generated.
53+
* An implementation MUST NOT generate ElGamal signatures.
54+
*/
55+
int ELGAMAL_GENERAL = 20; // Reserved Elgamal (Encrypt or Sign)
56+
/**
57+
* Reserved tag for IETF-style S/MIME Diffie-Hellman.
2258
*/
23-
int EC = 18; // Reserved for Elliptic Curve
24-
int ECDH = 18; // Reserved for Elliptic Curve (actual algorithm name)
25-
int ECDSA = 19; // Reserved for ECDSA
26-
int ELGAMAL_GENERAL = 20; // Elgamal (Encrypt or Sign)
2759
int DIFFIE_HELLMAN = 21; // Reserved for Diffie-Hellman (X9.42, as defined for IETF-S/MIME)
2860
/**
29-
* @deprecated use Ed25519 or Ed448
61+
* Misnamed tag for legacy EdDSA.
62+
* @deprecated use {@link #EDDSA_LEGACY} instead.
63+
*/
64+
int EDDSA = 22; // EdDSA - (internet draft, but appearing in use); misnamed constant
65+
/**
66+
* Legacy EdDSA (curve identified by OID).
67+
* MUST NOT be used with v6 keys (use {@link #Ed25519}, {@link #Ed448} instead).
3068
*/
31-
int EDDSA = 22; // EdDSA - (internet draft, but appearing in use)
3269
int EDDSA_LEGACY = 22; // new name for old EDDSA tag.
33-
34-
int X25519 = 25;
35-
int X448 = 26;
36-
int Ed25519 = 27;
37-
int Ed448 = 28;
70+
/**
71+
* X25519 encryption algorithm.
72+
* C-R compliant implementations MUST implement support for this.
73+
*/
74+
int X25519 = 25; // X25519
75+
/**
76+
* X448 encryption algorithm.
77+
*/
78+
int X448 = 26; // X448
79+
/**
80+
* Ed25519 signing algorithm.
81+
* C-R compliant implementations MUST implement support for this.
82+
*/
83+
int Ed25519 = 27; // new style Ed25519
84+
/**
85+
* Ed448 signing algorithm.
86+
*/
87+
int Ed448 = 28; // new style Ed448
3888

3989
int EXPERIMENTAL_1 = 100;
4090
int EXPERIMENTAL_2 = 101;

0 commit comments

Comments
 (0)