001/**
002 *
003 * Copyright 2018 Paul Schaub.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.ox.crypto;
018
019import org.jivesoftware.smackx.ox.element.OpenPgpElement;
020
021import org.pgpainless.decryption_verification.OpenPgpMetadata;
022import org.pgpainless.encryption_signing.EncryptionResult;
023
024/**
025 * Bundle together an {@link OpenPgpElement} and {@link OpenPgpMetadata}.
026 */
027public class OpenPgpElementAndMetadata {
028
029    private final OpenPgpElement element;
030    private final EncryptionResult metadata;
031
032    /**
033     * Constructor.
034     *
035     * @param element element
036     * @param metadata metadata about the elements encryption
037     */
038    public OpenPgpElementAndMetadata(OpenPgpElement element, EncryptionResult metadata) {
039        this.element = element;
040        this.metadata = metadata;
041    }
042
043    /**
044     * Return the {@link OpenPgpElement}.
045     *
046     * @return element TODO javadoc me please
047     */
048    public OpenPgpElement getElement() {
049        return element;
050    }
051
052    /**
053     * Return an {@link EncryptionResult} containing metadata about the {@link OpenPgpElement}s encryption/signatures.
054     *
055     * @return metadata TODO javadoc me please
056     */
057    public EncryptionResult getMetadata() {
058        return metadata;
059    }
060}