Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 72f9060

Browse files
committed
Added Javadoc comments for a few constant fields
1 parent 9466111 commit 72f9060

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/java/no/uio/ifi/crypt4gh/util/KeyUtils.java

+21
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,37 @@
3636
*/
3737
public class KeyUtils {
3838

39+
/** A constant string with the value "ChaCha20" */
3940
public static final String CHA_CHA_20 = "ChaCha20";
41+
42+
/** A constant string with the value "X25519" */
4043
public static final String X25519 = "X25519";
4144

45+
/** Header line text for public key file in OpenSSL format */
4246
public static final String BEGIN_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----";
47+
48+
/** Footer line text for public key file in OpenSSL format */
4349
public static final String END_PUBLIC_KEY = "-----END PUBLIC KEY-----";
50+
51+
/** Header line text for private key file in OpenSSL format */
4452
public static final String BEGIN_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----";
53+
54+
/** Footer line text for private key file in OpenSSL format */
4555
public static final String END_PRIVATE_KEY = "-----END PRIVATE KEY-----";
56+
57+
/** Header line text for public key file in Crypt4GH format */
4658
public static final String BEGIN_CRYPT4GH_PUBLIC_KEY = "-----BEGIN CRYPT4GH PUBLIC KEY-----";
59+
60+
/** Footer line text for public key file in Crypt4GH format */
4761
public static final String END_CRYPT4GH_PUBLIC_KEY = "-----END CRYPT4GH PUBLIC KEY-----";
62+
63+
/** Header line text for private key file in Crypt4GH format */
4864
public static final String BEGIN_CRYPT4GH_ENCRYPTED_PRIVATE_KEY = "-----BEGIN CRYPT4GH ENCRYPTED PRIVATE KEY-----";
65+
66+
/** Footer line text for private key file in Crypt4GH format */
4967
public static final String END_CRYPT4GH_ENCRYPTED_PRIVATE_KEY = "-----END CRYPT4GH ENCRYPTED PRIVATE KEY-----";
5068

69+
/** Magic number string used at the beginning of private key files in Crypt4GH format */
5170
public static final String CRYPT4GH_AUTH_MAGIC = "c4gh-v1";
5271

5372
private static KeyUtils ourInstance = new KeyUtils();
@@ -371,6 +390,7 @@ public void writeOpenSSLKey(Writer writer, Key key) throws IOException {
371390
* @param key Key to write.
372391
* @param password Password to lock private key.
373392
* @throws IOException If the file can't be written.
393+
* @throws GeneralSecurityException If the key was not XECPublicKey or XECPrivateKey.
374394
*/
375395
public void writeCrypt4GHKey(Writer writer, Key key, char[] password) throws IOException, GeneralSecurityException {
376396
Collection<String> keyLines = new ArrayList<>();
@@ -425,6 +445,7 @@ public void writeOpenSSLKey(File keyFile, Key key) throws IOException {
425445
* @param key Key to write.
426446
* @param password Password to lock private key.
427447
* @throws IOException If the file can't be written.
448+
* @throws GeneralSecurityException If the key was not XECPublicKey or XECPrivateKey.
428449
*/
429450
public void writeCrypt4GHKey(File keyFile, Key key, char[] password) throws IOException, GeneralSecurityException {
430451
try (FileWriter fileWriter = new FileWriter(keyFile)) {

0 commit comments

Comments
 (0)