2021-10-07 15:48:52 +02:00
|
|
|
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2021-05-06 00:04:03 +02:00
|
|
|
package org.pgpainless.algorithm;
|
|
|
|
|
2021-05-25 14:16:12 +02:00
|
|
|
/**
|
|
|
|
* Subset of {@link SignatureType}, used for signatures over documents.
|
|
|
|
*/
|
2021-05-06 00:04:03 +02:00
|
|
|
public enum DocumentSignatureType {
|
|
|
|
|
2021-05-25 14:16:12 +02:00
|
|
|
/**
|
|
|
|
* Signature is calculated over the unchanged binary data.
|
|
|
|
*/
|
2021-05-06 00:04:03 +02:00
|
|
|
BINARY_DOCUMENT(SignatureType.BINARY_DOCUMENT),
|
|
|
|
|
2021-05-25 14:16:12 +02:00
|
|
|
/**
|
|
|
|
* The signature is calculated over the text data with its line endings converted to
|
|
|
|
* <pre>
|
|
|
|
* {@code <CR><LF>}
|
|
|
|
* </pre>.
|
|
|
|
*/
|
2021-05-06 00:04:03 +02:00
|
|
|
CANONICAL_TEXT_DOCUMENT(SignatureType.CANONICAL_TEXT_DOCUMENT),
|
|
|
|
;
|
|
|
|
|
|
|
|
final SignatureType signatureType;
|
|
|
|
|
|
|
|
DocumentSignatureType(SignatureType signatureType) {
|
|
|
|
this.signatureType = signatureType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public SignatureType getSignatureType() {
|
|
|
|
return signatureType;
|
|
|
|
}
|
|
|
|
}
|