mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-23 04:42:06 +01:00
Add documentation for openpgp4fpr fingerprint methods
This commit is contained in:
parent
46af22cc50
commit
0a3f688b23
1 changed files with 15 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2018 Paul Schaub.
|
* Copyright 2018-2020 Paul Schaub.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -142,6 +142,13 @@ public class OpenPgpV4Fingerprint implements CharSequence, Comparable<OpenPgpV4F
|
||||||
return fingerprint;
|
return fingerprint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the fingerprint as an openpgp4fpr {@link URI}.
|
||||||
|
* An example would be 'openpgp4fpr:7F9116FEA90A5983936C7CFAA027DB2F3E1E118A'.
|
||||||
|
*
|
||||||
|
* @return openpgp4fpr fingerprint uri
|
||||||
|
* @see <a href="https://metacode.biz/openpgp/openpgp4fpr">openpgp4fpr URI scheme</a>
|
||||||
|
*/
|
||||||
public URI toUri() {
|
public URI toUri() {
|
||||||
try {
|
try {
|
||||||
return new URI(SCHEME, toString(), null);
|
return new URI(SCHEME, toString(), null);
|
||||||
|
@ -150,6 +157,13 @@ public class OpenPgpV4Fingerprint implements CharSequence, Comparable<OpenPgpV4F
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert a openpgp4fpr URI to an {@link OpenPgpV4Fingerprint}.
|
||||||
|
*
|
||||||
|
* @param uri {@link URI} with scheme 'openpgp4fpr'
|
||||||
|
* @return fingerprint parsed from the uri
|
||||||
|
* @see <a href="https://metacode.biz/openpgp/openpgp4fpr">openpgp4fpr URI scheme</a>
|
||||||
|
*/
|
||||||
public static OpenPgpV4Fingerprint fromUri(URI uri) {
|
public static OpenPgpV4Fingerprint fromUri(URI uri) {
|
||||||
if (!SCHEME.equals(uri.getScheme())) {
|
if (!SCHEME.equals(uri.getScheme())) {
|
||||||
throw new IllegalArgumentException("URI scheme MUST equal '" + SCHEME + "'");
|
throw new IllegalArgumentException("URI scheme MUST equal '" + SCHEME + "'");
|
||||||
|
|
Loading…
Reference in a new issue