diff options
Diffstat (limited to 'mailnews/extensions/smime/public')
7 files changed, 211 insertions, 0 deletions
diff --git a/mailnews/extensions/smime/public/moz.build b/mailnews/extensions/smime/public/moz.build new file mode 100644 index 000000000..b7acbb0b2 --- /dev/null +++ b/mailnews/extensions/smime/public/moz.build @@ -0,0 +1,15 @@ +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +XPIDL_SOURCES += [ + 'nsICertPickDialogs.idl', + 'nsIEncryptedSMIMEURIsSrvc.idl', + 'nsIMsgSMIMECompFields.idl', + 'nsIMsgSMIMEHeaderSink.idl', + 'nsISMimeJSHelper.idl', + 'nsIUserCertPicker.idl', +] + +XPIDL_MODULE = 'msgsmime' diff --git a/mailnews/extensions/smime/public/nsICertPickDialogs.idl b/mailnews/extensions/smime/public/nsICertPickDialogs.idl new file mode 100644 index 000000000..01a7f3712 --- /dev/null +++ b/mailnews/extensions/smime/public/nsICertPickDialogs.idl @@ -0,0 +1,30 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIInterfaceRequestor; + +/** + * nsICertPickDialogs + * Provides generic UI for choosing a certificate + */ +[scriptable, uuid(51d59b08-1dd2-11b2-ad4a-a51b92f8a184)] +interface nsICertPickDialogs : nsISupports +{ + /** + * PickCertificate + * General purpose certificate prompter + */ + void PickCertificate(in nsIInterfaceRequestor ctx, + [array, size_is(count)] in wstring certNickList, + [array, size_is(count)] in wstring certDetailsList, + in unsigned long count, + inout long selectedIndex, + out boolean canceled); +}; + +%{C++ +#define NS_CERTPICKDIALOGS_CONTRACTID "@mozilla.org/nsCertPickDialogs;1" +%} diff --git a/mailnews/extensions/smime/public/nsIEncryptedSMIMEURIsSrvc.idl b/mailnews/extensions/smime/public/nsIEncryptedSMIMEURIsSrvc.idl new file mode 100644 index 000000000..4b2b7c25c --- /dev/null +++ b/mailnews/extensions/smime/public/nsIEncryptedSMIMEURIsSrvc.idl @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* This is a private interface used exclusively by SMIME. + It provides functionality to the JS UI code, + that is only accessible from C++. +*/ + +#include "nsISupports.idl" + +[scriptable, uuid(f86e55c9-530b-483f-91a7-10fb5b852488)] +interface nsIEncryptedSMIMEURIsService : nsISupports +{ + /// Remember that this URI is encrypted. + void rememberEncrypted(in AUTF8String uri); + + /// Forget that this URI is encrypted. + void forgetEncrypted(in AUTF8String uri); + + /// Check if this URI is encrypted. + boolean isEncrypted(in AUTF8String uri); +}; diff --git a/mailnews/extensions/smime/public/nsIMsgSMIMECompFields.idl b/mailnews/extensions/smime/public/nsIMsgSMIMECompFields.idl new file mode 100644 index 000000000..0688afd76 --- /dev/null +++ b/mailnews/extensions/smime/public/nsIMsgSMIMECompFields.idl @@ -0,0 +1,18 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/* This is a private interface used exclusively by SMIME. NO ONE outside of extensions/smime + should have any knowledge nor should be referring to this interface. +*/ + +#include "nsISupports.idl" + +[scriptable, uuid(338E91F9-5970-4f81-B771-0822A32B1161)] +interface nsIMsgSMIMECompFields : nsISupports +{ + attribute boolean signMessage; + attribute boolean requireEncryptMessage; +}; diff --git a/mailnews/extensions/smime/public/nsIMsgSMIMEHeaderSink.idl b/mailnews/extensions/smime/public/nsIMsgSMIMEHeaderSink.idl new file mode 100644 index 000000000..9bfa41a04 --- /dev/null +++ b/mailnews/extensions/smime/public/nsIMsgSMIMEHeaderSink.idl @@ -0,0 +1,23 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/* This is a private interface used exclusively by SMIME. NO ONE outside of extensions/smime + or the hard coded smime decryption files in mime/src should have any knowledge nor should + be referring to this interface. +*/ + +#include "nsISupports.idl" + +interface nsIX509Cert; + +[scriptable, uuid(25380FA1-E70C-4e82-B0BC-F31C2F41C470)] +interface nsIMsgSMIMEHeaderSink : nsISupports +{ + void signedStatus(in long aNestingLevel, in long aSignatureStatus, in nsIX509Cert aSignerCert); + void encryptionStatus(in long aNestingLevel, in long aEncryptionStatus, in nsIX509Cert aReceipientCert); + + long maxWantedNesting(); // 1 == only info on outermost nesting level wanted +}; diff --git a/mailnews/extensions/smime/public/nsISMimeJSHelper.idl b/mailnews/extensions/smime/public/nsISMimeJSHelper.idl new file mode 100644 index 000000000..c29a77939 --- /dev/null +++ b/mailnews/extensions/smime/public/nsISMimeJSHelper.idl @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* This is a private interface used exclusively by SMIME. + It provides functionality to the JS UI code, + that is only accessible from C++. +*/ + +#include "nsISupports.idl" + +interface nsIMsgCompFields; +interface nsIX509Cert; + +[scriptable, uuid(a54e3c8f-a000-4901-898f-fafb297b1546)] +interface nsISMimeJSHelper : nsISupports +{ + /** + * Obtains detailed information about the certificate availability + * status of email recipients. + * + * @param compFields - Attributes of the composed message + * + * @param count - The number of entries in returned arrays + * + * @param emailAddresses - The list of all recipient email addresses + * + * @param certVerification - The verification/validity status of recipient certs + * + * @param certIssuedInfos - If a recipient cert was found, when has it been issued? + * + * @param certExpiredInfos - If a recipient cert was found, when will it expire? + * + * @param certs - The recipient certificates, which can contain null for not found + * + * @param canEncrypt - whether valid certificates have been found for all recipients + * + * @exception NS_ERROR_FAILURE - unexptected failure + * + * @exception NS_ERROR_OUT_OF_MEMORY - could not create the out list + * + * @exception NS_ERROR_INVALID_ARG + */ + void getRecipientCertsInfo(in nsIMsgCompFields compFields, + out unsigned long count, + [array, size_is(count)] out wstring emailAddresses, + [array, size_is(count)] out long certVerification, + [array, size_is(count)] out wstring certIssuedInfos, + [array, size_is(count)] out wstring certExpiresInfos, + [array, size_is(count)] out nsIX509Cert certs, + out boolean canEncrypt); + + /** + * Obtains a list of email addresses where valid email recipient certificates + * are not yet available. + * + * @param compFields - Attributes of the composed message + * + * @param count - The number of returned email addresses + * + * @param emailAddresses - The list of email addresses without valid certs + * + * @exception NS_ERROR_FAILURE - unexptected failure + * + * @exception NS_ERROR_OUT_OF_MEMORY - could not create the out list + * + * @exception NS_ERROR_INVALID_ARG + */ + void getNoCertAddresses(in nsIMsgCompFields compFields, + out unsigned long count, + [array, size_is(count)] out wstring emailAddresses); +}; diff --git a/mailnews/extensions/smime/public/nsIUserCertPicker.idl b/mailnews/extensions/smime/public/nsIUserCertPicker.idl new file mode 100644 index 000000000..666941c29 --- /dev/null +++ b/mailnews/extensions/smime/public/nsIUserCertPicker.idl @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIX509Cert; +interface nsIInterfaceRequestor; + +[scriptable, uuid(92396323-23f2-49e0-bf98-a25a725231ab)] +interface nsIUserCertPicker : nsISupports { + nsIX509Cert pickByUsage(in nsIInterfaceRequestor ctx, + in wstring selectedNickname, + in long certUsage, // as defined by NSS enum SECCertUsage + in boolean allowInvalid, + in boolean allowDuplicateNicknames, + in AString emailAddress, // optional - if non-empty, + // skip certificates which + // have at least one e-mail + // address but do not + // include this specific one + out boolean canceled); +}; + +%{C++ +#define NS_CERT_PICKER_CONTRACTID "@mozilla.org/user_cert_picker;1" +%} |