mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-19 02:42:05 +01:00
Kotlin conversion: DocumentSignatureType
This commit is contained in:
parent
dfb33a5ecb
commit
e9dceb4553
2 changed files with 20 additions and 35 deletions
|
@ -1,35 +0,0 @@
|
||||||
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
package org.pgpainless.algorithm;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Subset of {@link SignatureType}, used for signatures over documents.
|
|
||||||
*/
|
|
||||||
public enum DocumentSignatureType {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Signature is calculated over the unchanged binary data.
|
|
||||||
*/
|
|
||||||
BINARY_DOCUMENT(SignatureType.BINARY_DOCUMENT),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The signature is calculated over the text data with its line endings converted to
|
|
||||||
* <pre>
|
|
||||||
* {@code <CR><LF>}
|
|
||||||
* </pre>.
|
|
||||||
*/
|
|
||||||
CANONICAL_TEXT_DOCUMENT(SignatureType.CANONICAL_TEXT_DOCUMENT),
|
|
||||||
;
|
|
||||||
|
|
||||||
final SignatureType signatureType;
|
|
||||||
|
|
||||||
DocumentSignatureType(SignatureType signatureType) {
|
|
||||||
this.signatureType = signatureType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SignatureType getSignatureType() {
|
|
||||||
return signatureType;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package org.pgpainless.algorithm
|
||||||
|
|
||||||
|
enum class DocumentSignatureType(val signatureType: SignatureType) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signature is calculated over the unchanged binary data.
|
||||||
|
*/
|
||||||
|
BINARY_DOCUMENT(SignatureType.BINARY_DOCUMENT),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The signature is calculated over the text data with its line endings
|
||||||
|
* converted to `<CR><LF>`.
|
||||||
|
*/
|
||||||
|
CANONICAL_TEXT_DOCUMENT(SignatureType.CANONICAL_TEXT_DOCUMENT),
|
||||||
|
;
|
||||||
|
}
|
Loading…
Reference in a new issue