001// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
002//
003// SPDX-License-Identifier: Apache-2.0
004
005package org.pgpainless.algorithm;
006
007/**
008 * Subset of {@link SignatureType}, used for signatures over documents.
009 */
010public enum DocumentSignatureType {
011
012    /**
013     * Signature is calculated over the unchanged binary data.
014     */
015    BINARY_DOCUMENT(SignatureType.BINARY_DOCUMENT),
016
017    /**
018     * The signature is calculated over the text data with its line endings converted to
019     * <pre>
020     *     {@code &lt;CR&gt;&lt;LF&gt;}
021     * </pre>.
022     */
023    CANONICAL_TEXT_DOCUMENT(SignatureType.CANONICAL_TEXT_DOCUMENT),
024    ;
025
026    final SignatureType signatureType;
027
028    DocumentSignatureType(SignatureType signatureType) {
029        this.signatureType = signatureType;
030    }
031
032    public SignatureType getSignatureType() {
033        return signatureType;
034    }
035}