+ private X509Certificate c;
+
+ private PrivateKey k;
+
+ protected void init(Certificate c, Key k) {
+ this.c = (X509Certificate) c;
+ this.k = (PrivateKey) k;
+ }
+
+ protected final void sendSigned(String contents, PrintWriter output) throws IOException, GeneralSecurityException {
+ if (k == null || c == null) {
+ output.println("Content-Transfer-Encoding: base64");
+ output.println();
+ output.print(contents);
+ } else {
+ SMIME.smime(contents, k, c, output);
+ }
+ }
+