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; 022 023/** 024 * Bundle together an {@link OpenPgpElement} and {@link OpenPgpMetadata}. 025 */ 026public class OpenPgpElementAndMetadata { 027 028 private final OpenPgpElement element; 029 private final OpenPgpMetadata metadata; 030 031 /** 032 * Constructor. 033 * 034 * @param element element 035 * @param metadata metadata about the elements encryption 036 */ 037 public OpenPgpElementAndMetadata(OpenPgpElement element, OpenPgpMetadata metadata) { 038 this.element = element; 039 this.metadata = metadata; 040 } 041 042 /** 043 * Return the {@link OpenPgpElement}. 044 * 045 * @return element TODO javadoc me please 046 */ 047 public OpenPgpElement getElement() { 048 return element; 049 } 050 051 /** 052 * Return {@link OpenPgpMetadata} about the {@link OpenPgpElement}s encryption/signatures. 053 * 054 * @return metadata TODO javadoc me please 055 */ 056 public OpenPgpMetadata getMetadata() { 057 return metadata; 058 } 059}