001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. 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.apache.camel.model.dataformat; 018 019import javax.xml.bind.annotation.XmlAccessType; 020import javax.xml.bind.annotation.XmlAccessorType; 021import javax.xml.bind.annotation.XmlAttribute; 022import javax.xml.bind.annotation.XmlRootElement; 023 024import org.apache.camel.CamelContext; 025import org.apache.camel.model.DataFormatDefinition; 026import org.apache.camel.spi.DataFormat; 027 028/** 029 * Represents a <a href="http://camel.apache.org/crypto.html">pgp</a> 030 * {@link org.apache.camel.spi.DataFormat}. 031 */ 032@XmlRootElement(name = "pgp") 033@XmlAccessorType(XmlAccessType.FIELD) 034public class PGPDataFormat extends DataFormatDefinition { 035 @XmlAttribute 036 private String keyUserid; 037 @XmlAttribute 038 private String signatureKeyUserid; 039 @XmlAttribute 040 private String password; 041 @XmlAttribute 042 private String signaturePassword; 043 @XmlAttribute 044 private String keyFileName; 045 @XmlAttribute 046 private String signatureKeyFileName; 047 @XmlAttribute 048 private Boolean armored; 049 @XmlAttribute 050 private Boolean integrity; 051 @XmlAttribute 052 private String provider; 053 @XmlAttribute 054 private Integer algorithm; 055 @XmlAttribute 056 private Integer compressionAlgorithm; 057 @XmlAttribute 058 private Integer hashAlgorithm; 059 @XmlAttribute 060 private String signatureVerificationOption; 061 062 public PGPDataFormat() { 063 super("pgp"); 064 } 065 066 @Override 067 protected void configureDataFormat(DataFormat dataFormat, CamelContext camelContext) { 068 if (keyUserid != null) { 069 setProperty(camelContext, dataFormat, "keyUserid", keyUserid); 070 } 071 if (signatureKeyUserid != null) { 072 setProperty(camelContext, dataFormat, "signatureKeyUserid", signatureKeyUserid); 073 } 074 if (password != null) { 075 setProperty(camelContext, dataFormat, "password", password); 076 } 077 if (signaturePassword != null) { 078 setProperty(camelContext, dataFormat, "signaturePassword", signaturePassword); 079 } 080 if (keyFileName != null) { 081 setProperty(camelContext, dataFormat, "keyFileName", keyFileName); 082 } 083 if (signatureKeyFileName != null) { 084 setProperty(camelContext, dataFormat, "signatureKeyFileName", signatureKeyFileName); 085 } 086 if (armored != null) { 087 setProperty(camelContext, dataFormat, "armored", armored); 088 } 089 if (integrity != null) { 090 setProperty(camelContext, dataFormat, "integrity", integrity); 091 } 092 if (provider != null) { 093 setProperty(camelContext, dataFormat, "provider", provider); 094 } 095 if (algorithm != null) { 096 setProperty(camelContext, dataFormat, "algorithm", algorithm); 097 } 098 if (compressionAlgorithm != null) { 099 setProperty(camelContext, dataFormat, "compressionAlgorithm", compressionAlgorithm); 100 } 101 if (hashAlgorithm != null) { 102 setProperty(camelContext, dataFormat, "hashAlgorithm", hashAlgorithm); 103 } 104 if (signatureVerificationOption != null) { 105 setProperty(camelContext, dataFormat, "signatureVerificationOption", signatureVerificationOption); 106 } 107 } 108 109 public String getSignatureKeyUserid() { 110 return signatureKeyUserid; 111 } 112 113 public void setSignatureKeyUserid(String signatureKeyUserid) { 114 this.signatureKeyUserid = signatureKeyUserid; 115 } 116 117 public String getSignaturePassword() { 118 return signaturePassword; 119 } 120 121 public void setSignaturePassword(String signaturePassword) { 122 this.signaturePassword = signaturePassword; 123 } 124 125 public String getSignatureKeyFileName() { 126 return signatureKeyFileName; 127 } 128 129 public void setSignatureKeyFileName(String signatureKeyFileName) { 130 this.signatureKeyFileName = signatureKeyFileName; 131 } 132 133 public Integer getHashAlgorithm() { 134 return hashAlgorithm; 135 } 136 137 public void setHashAlgorithm(Integer hashAlgorithm) { 138 this.hashAlgorithm = hashAlgorithm; 139 } 140 141 public Boolean getArmored() { 142 return armored; 143 } 144 145 public void setArmored(Boolean armored) { 146 this.armored = armored; 147 } 148 149 public Boolean getIntegrity() { 150 return integrity; 151 } 152 153 public void setIntegrity(Boolean integrity) { 154 this.integrity = integrity; 155 } 156 157 public String getKeyFileName() { 158 return keyFileName; 159 } 160 161 public void setKeyFileName(String keyFileName) { 162 this.keyFileName = keyFileName; 163 } 164 165 public String getKeyUserid() { 166 return keyUserid; 167 } 168 169 public void setKeyUserid(String keyUserid) { 170 this.keyUserid = keyUserid; 171 } 172 173 public String getPassword() { 174 return password; 175 } 176 177 public Integer getAlgorithm() { 178 return algorithm; 179 } 180 181 public void setAlgorithm(Integer algorithm) { 182 this.algorithm = algorithm; 183 } 184 185 public Integer getCompressionAlgorithm() { 186 return compressionAlgorithm; 187 } 188 189 public void setCompressionAlgorithm(Integer compressionAlgorithm) { 190 this.compressionAlgorithm = compressionAlgorithm; 191 } 192 193 public void setPassword(String password) { 194 this.password = password; 195 } 196 197 public String getProvider() { 198 return provider; 199 } 200 201 public void setProvider(String provider) { 202 this.provider = provider; 203 } 204 205 public String getSignatureVerificationOption() { 206 return signatureVerificationOption; 207 } 208 209 public void setSignatureVerificationOption(String signatureVerificationOption) { 210 this.signatureVerificationOption = signatureVerificationOption; 211 } 212}