/* * DO NOT EDIT. THIS FILE IS GENERATED FROM nsICMS.idl */ #ifndef __gen_nsICMS_h__ #define __gen_nsICMS_h__ #ifndef __gen_nsISupports_h__ #include "nsISupports.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif class nsISupportsArray; /* forward declaration */ class nsIX509Cert; /* forward declaration */ typedef void (*NSSCMSContentCallback)(void *arg, const char *buf, unsigned long len); /* starting interface: nsIHash */ #define NS_IHASH_IID_STR "a31a3028-ae28-11d5-ba4b-00108303b117" #define NS_IHASH_IID \ {0xa31a3028, 0xae28, 0x11d5, \ { 0xba, 0x4b, 0x00, 0x10, 0x83, 0x03, 0xb1, 0x17 }} class NS_NO_VTABLE nsIHash : public nsISupports { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHASH_IID) enum { HASH_AlgNULL = 0 }; enum { HASH_AlgMD2 = 1 }; enum { HASH_AlgMD5 = 2 }; enum { HASH_AlgSHA1 = 3 }; enum { MD2_LEN = 16U }; enum { MD5_LEN = 16U }; enum { SHA1_LEN = 20U }; enum { MAX_HASH_LEN = 20U }; /* unsigned long resultLen (in short aAlg); */ NS_IMETHOD ResultLen(PRInt16 aAlg, PRUint32 *_retval) = 0; /* void create (in short aAlg); */ NS_IMETHOD Create(PRInt16 aAlg) = 0; /* void begin (); */ NS_IMETHOD Begin(void) = 0; /* void update (in UnsignedCharPtr aBuf, in unsigned long aLen); */ NS_IMETHOD Update(unsigned char * aBuf, PRUint32 aLen) = 0; /* void end (in UnsignedCharPtr aHash, out unsigned long aLen, in unsigned long aMaxLen); */ NS_IMETHOD End(unsigned char * aHash, PRUint32 *aLen, PRUint32 aMaxLen) = 0; }; /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIHASH \ NS_IMETHOD ResultLen(PRInt16 aAlg, PRUint32 *_retval); \ NS_IMETHOD Create(PRInt16 aAlg); \ NS_IMETHOD Begin(void); \ NS_IMETHOD Update(unsigned char * aBuf, PRUint32 aLen); \ NS_IMETHOD End(unsigned char * aHash, PRUint32 *aLen, PRUint32 aMaxLen); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIHASH(_to) \ NS_IMETHOD ResultLen(PRInt16 aAlg, PRUint32 *_retval) { return _to ResultLen(aAlg, _retval); } \ NS_IMETHOD Create(PRInt16 aAlg) { return _to Create(aAlg); } \ NS_IMETHOD Begin(void) { return _to Begin(); } \ NS_IMETHOD Update(unsigned char * aBuf, PRUint32 aLen) { return _to Update(aBuf, aLen); } \ NS_IMETHOD End(unsigned char * aHash, PRUint32 *aLen, PRUint32 aMaxLen) { return _to End(aHash, aLen, aMaxLen); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIHASH(_to) \ NS_IMETHOD ResultLen(PRInt16 aAlg, PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResultLen(aAlg, _retval); } \ NS_IMETHOD Create(PRInt16 aAlg) { return !_to ? NS_ERROR_NULL_POINTER : _to->Create(aAlg); } \ NS_IMETHOD Begin(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Begin(); } \ NS_IMETHOD Update(unsigned char * aBuf, PRUint32 aLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->Update(aBuf, aLen); } \ NS_IMETHOD End(unsigned char * aHash, PRUint32 *aLen, PRUint32 aMaxLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->End(aHash, aLen, aMaxLen); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsHash : public nsIHash { public: NS_DECL_ISUPPORTS NS_DECL_NSIHASH nsHash(); virtual ~nsHash(); /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsHash, nsIHash) nsHash::nsHash() { NS_INIT_ISUPPORTS(); /* member initializers and constructor code */ } nsHash::~nsHash() { /* destructor code */ } /* unsigned long resultLen (in short aAlg); */ NS_IMETHODIMP nsHash::ResultLen(PRInt16 aAlg, PRUint32 *_retval) { return NS_ERROR_NOT_IMPLEMENTED; } /* void create (in short aAlg); */ NS_IMETHODIMP nsHash::Create(PRInt16 aAlg) { return NS_ERROR_NOT_IMPLEMENTED; } /* void begin (); */ NS_IMETHODIMP nsHash::Begin() { return NS_ERROR_NOT_IMPLEMENTED; } /* void update (in UnsignedCharPtr aBuf, in unsigned long aLen); */ NS_IMETHODIMP nsHash::Update(unsigned char * aBuf, PRUint32 aLen) { return NS_ERROR_NOT_IMPLEMENTED; } /* void end (in UnsignedCharPtr aHash, out unsigned long aLen, in unsigned long aMaxLen); */ NS_IMETHODIMP nsHash::End(unsigned char * aHash, PRUint32 *aLen, PRUint32 aMaxLen) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif /* starting interface: nsICMSMessage */ #define NS_ICMSMESSAGE_IID_STR "a4557478-ae16-11d5-ba4b-00108303b117" #define NS_ICMSMESSAGE_IID \ {0xa4557478, 0xae16, 0x11d5, \ { 0xba, 0x4b, 0x00, 0x10, 0x83, 0x03, 0xb1, 0x17 }} /** * nsICMSMessage * Interface to a CMS Message */ class NS_NO_VTABLE nsICMSMessage : public nsISupports { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICMSMESSAGE_IID) /* void contentIsSigned (out boolean aSigned); */ NS_IMETHOD ContentIsSigned(PRBool *aSigned) = 0; /* void contentIsEncrypted (out boolean aEncrypted); */ NS_IMETHOD ContentIsEncrypted(PRBool *aEncrypted) = 0; /* void getSignerCommonName (out string aName); */ NS_IMETHOD GetSignerCommonName(char **aName) = 0; /* void getSignerEmailAddress (out string aEmail); */ NS_IMETHOD GetSignerEmailAddress(char **aEmail) = 0; /* void getSignerCert (out nsIX509Cert scert); */ NS_IMETHOD GetSignerCert(nsIX509Cert **scert) = 0; /* void getEncryptionCert (out nsIX509Cert ecert); */ NS_IMETHOD GetEncryptionCert(nsIX509Cert **ecert) = 0; /* void verifySignature (); */ NS_IMETHOD VerifySignature(void) = 0; /* void verifyDetachedSignature (in UnsignedCharPtr aDigestData, in unsigned long aDigestDataLen); */ NS_IMETHOD VerifyDetachedSignature(unsigned char * aDigestData, PRUint32 aDigestDataLen) = 0; /* void CreateEncrypted (in nsISupportsArray aRecipientCerts); */ NS_IMETHOD CreateEncrypted(nsISupportsArray *aRecipientCerts) = 0; /* void CreateSigned (in nsIX509Cert scert, in nsIX509Cert ecert, in UnsignedCharPtr aDigestData, in unsigned long aDigestDataLen); */ NS_IMETHOD CreateSigned(nsIX509Cert *scert, nsIX509Cert *ecert, unsigned char * aDigestData, PRUint32 aDigestDataLen) = 0; }; /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSICMSMESSAGE \ NS_IMETHOD ContentIsSigned(PRBool *aSigned); \ NS_IMETHOD ContentIsEncrypted(PRBool *aEncrypted); \ NS_IMETHOD GetSignerCommonName(char **aName); \ NS_IMETHOD GetSignerEmailAddress(char **aEmail); \ NS_IMETHOD GetSignerCert(nsIX509Cert **scert); \ NS_IMETHOD GetEncryptionCert(nsIX509Cert **ecert); \ NS_IMETHOD VerifySignature(void); \ NS_IMETHOD VerifyDetachedSignature(unsigned char * aDigestData, PRUint32 aDigestDataLen); \ NS_IMETHOD CreateEncrypted(nsISupportsArray *aRecipientCerts); \ NS_IMETHOD CreateSigned(nsIX509Cert *scert, nsIX509Cert *ecert, unsigned char * aDigestData, PRUint32 aDigestDataLen); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSICMSMESSAGE(_to) \ NS_IMETHOD ContentIsSigned(PRBool *aSigned) { return _to ContentIsSigned(aSigned); } \ NS_IMETHOD ContentIsEncrypted(PRBool *aEncrypted) { return _to ContentIsEncrypted(aEncrypted); } \ NS_IMETHOD GetSignerCommonName(char **aName) { return _to GetSignerCommonName(aName); } \ NS_IMETHOD GetSignerEmailAddress(char **aEmail) { return _to GetSignerEmailAddress(aEmail); } \ NS_IMETHOD GetSignerCert(nsIX509Cert **scert) { return _to GetSignerCert(scert); } \ NS_IMETHOD GetEncryptionCert(nsIX509Cert **ecert) { return _to GetEncryptionCert(ecert); } \ NS_IMETHOD VerifySignature(void) { return _to VerifySignature(); } \ NS_IMETHOD VerifyDetachedSignature(unsigned char * aDigestData, PRUint32 aDigestDataLen) { return _to VerifyDetachedSignature(aDigestData, aDigestDataLen); } \ NS_IMETHOD CreateEncrypted(nsISupportsArray *aRecipientCerts) { return _to CreateEncrypted(aRecipientCerts); } \ NS_IMETHOD CreateSigned(nsIX509Cert *scert, nsIX509Cert *ecert, unsigned char * aDigestData, PRUint32 aDigestDataLen) { return _to CreateSigned(scert, ecert, aDigestData, aDigestDataLen); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSICMSMESSAGE(_to) \ NS_IMETHOD ContentIsSigned(PRBool *aSigned) { return !_to ? NS_ERROR_NULL_POINTER : _to->ContentIsSigned(aSigned); } \ NS_IMETHOD ContentIsEncrypted(PRBool *aEncrypted) { return !_to ? NS_ERROR_NULL_POINTER : _to->ContentIsEncrypted(aEncrypted); } \ NS_IMETHOD GetSignerCommonName(char **aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSignerCommonName(aName); } \ NS_IMETHOD GetSignerEmailAddress(char **aEmail) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSignerEmailAddress(aEmail); } \ NS_IMETHOD GetSignerCert(nsIX509Cert **scert) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSignerCert(scert); } \ NS_IMETHOD GetEncryptionCert(nsIX509Cert **ecert) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEncryptionCert(ecert); } \ NS_IMETHOD VerifySignature(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifySignature(); } \ NS_IMETHOD VerifyDetachedSignature(unsigned char * aDigestData, PRUint32 aDigestDataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifyDetachedSignature(aDigestData, aDigestDataLen); } \ NS_IMETHOD CreateEncrypted(nsISupportsArray *aRecipientCerts) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateEncrypted(aRecipientCerts); } \ NS_IMETHOD CreateSigned(nsIX509Cert *scert, nsIX509Cert *ecert, unsigned char * aDigestData, PRUint32 aDigestDataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateSigned(scert, ecert, aDigestData, aDigestDataLen); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsCMSMessage : public nsICMSMessage { public: NS_DECL_ISUPPORTS NS_DECL_NSICMSMESSAGE nsCMSMessage(); virtual ~nsCMSMessage(); /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsCMSMessage, nsICMSMessage) nsCMSMessage::nsCMSMessage() { NS_INIT_ISUPPORTS(); /* member initializers and constructor code */ } nsCMSMessage::~nsCMSMessage() { /* destructor code */ } /* void contentIsSigned (out boolean aSigned); */ NS_IMETHODIMP nsCMSMessage::ContentIsSigned(PRBool *aSigned) { return NS_ERROR_NOT_IMPLEMENTED; } /* void contentIsEncrypted (out boolean aEncrypted); */ NS_IMETHODIMP nsCMSMessage::ContentIsEncrypted(PRBool *aEncrypted) { return NS_ERROR_NOT_IMPLEMENTED; } /* void getSignerCommonName (out string aName); */ NS_IMETHODIMP nsCMSMessage::GetSignerCommonName(char **aName) { return NS_ERROR_NOT_IMPLEMENTED; } /* void getSignerEmailAddress (out string aEmail); */ NS_IMETHODIMP nsCMSMessage::GetSignerEmailAddress(char **aEmail) { return NS_ERROR_NOT_IMPLEMENTED; } /* void getSignerCert (out nsIX509Cert scert); */ NS_IMETHODIMP nsCMSMessage::GetSignerCert(nsIX509Cert **scert) { return NS_ERROR_NOT_IMPLEMENTED; } /* void getEncryptionCert (out nsIX509Cert ecert); */ NS_IMETHODIMP nsCMSMessage::GetEncryptionCert(nsIX509Cert **ecert) { return NS_ERROR_NOT_IMPLEMENTED; } /* void verifySignature (); */ NS_IMETHODIMP nsCMSMessage::VerifySignature() { return NS_ERROR_NOT_IMPLEMENTED; } /* void verifyDetachedSignature (in UnsignedCharPtr aDigestData, in unsigned long aDigestDataLen); */ NS_IMETHODIMP nsCMSMessage::VerifyDetachedSignature(unsigned char * aDigestData, PRUint32 aDigestDataLen) { return NS_ERROR_NOT_IMPLEMENTED; } /* void CreateEncrypted (in nsISupportsArray aRecipientCerts); */ NS_IMETHODIMP nsCMSMessage::CreateEncrypted(nsISupportsArray *aRecipientCerts) { return NS_ERROR_NOT_IMPLEMENTED; } /* void CreateSigned (in nsIX509Cert scert, in nsIX509Cert ecert, in UnsignedCharPtr aDigestData, in unsigned long aDigestDataLen); */ NS_IMETHODIMP nsCMSMessage::CreateSigned(nsIX509Cert *scert, nsIX509Cert *ecert, unsigned char * aDigestData, PRUint32 aDigestDataLen) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif /* starting interface: nsICMSMessageErrors */ #define NS_ICMSMESSAGEERRORS_IID_STR "f2aec680-60a0-49f0-afe5-6cf1d3f15e0d" #define NS_ICMSMESSAGEERRORS_IID \ {0xf2aec680, 0x60a0, 0x49f0, \ { 0xaf, 0xe5, 0x6c, 0xf1, 0xd3, 0xf1, 0x5e, 0x0d }} /** * nsICMSMessageErrors * Scriptable error constants for nsICMSMessage */ class NS_NO_VTABLE nsICMSMessageErrors : public nsISupports { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICMSMESSAGEERRORS_IID) enum { SUCCESS = 0 }; enum { GENERAL_ERROR = 1 }; enum { VERIFY_NOT_SIGNED = 1024 }; enum { VERIFY_NO_CONTENT_INFO = 1025 }; enum { VERIFY_BAD_DIGEST = 1026 }; enum { VERIFY_NOCERT = 1028 }; enum { VERIFY_UNTRUSTED = 1029 }; enum { VERIFY_ERROR_UNVERIFIED = 1031 }; enum { VERIFY_ERROR_PROCESSING = 1032 }; enum { VERIFY_BAD_SIGNATURE = 1033 }; enum { VERIFY_DIGEST_MISMATCH = 1034 }; enum { VERIFY_UNKNOWN_ALGO = 1035 }; enum { VERIFY_UNSUPPORTED_ALGO = 1036 }; enum { VERIFY_MALFORMED_SIGNATURE = 1037 }; enum { VERIFY_HEADER_MISMATCH = 1038 }; enum { VERIFY_NOT_YET_ATTEMPTED = 1039 }; enum { ENCRYPT_NO_BULK_ALG = 1056 }; }; /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSICMSMESSAGEERRORS \ /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSICMSMESSAGEERRORS(_to) \ /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSICMSMESSAGEERRORS(_to) \ #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsCMSMessageErrors : public nsICMSMessageErrors { public: NS_DECL_ISUPPORTS NS_DECL_NSICMSMESSAGEERRORS nsCMSMessageErrors(); virtual ~nsCMSMessageErrors(); /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsCMSMessageErrors, nsICMSMessageErrors) nsCMSMessageErrors::nsCMSMessageErrors() { NS_INIT_ISUPPORTS(); /* member initializers and constructor code */ } nsCMSMessageErrors::~nsCMSMessageErrors() { /* destructor code */ } /* End of implementation class template. */ #endif /* starting interface: nsICMSDecoder */ #define NS_ICMSDECODER_IID_STR "65244a06-a342-11d5-ba47-00108303b117" #define NS_ICMSDECODER_IID \ {0x65244a06, 0xa342, 0x11d5, \ { 0xba, 0x47, 0x00, 0x10, 0x83, 0x03, 0xb1, 0x17 }} /** * nsICMSDecoder * Interface to decode an CMS message */ class NS_NO_VTABLE nsICMSDecoder : public nsISupports { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICMSDECODER_IID) /* void start (in NSSCMSContentCallback cb, in voidPtr arg); */ NS_IMETHOD Start(NSSCMSContentCallback cb, void * arg) = 0; /* void update (in string aBuf, in long aLen); */ NS_IMETHOD Update(const char *aBuf, PRInt32 aLen) = 0; /* void finish (out nsICMSMessage msg); */ NS_IMETHOD Finish(nsICMSMessage **msg) = 0; }; /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSICMSDECODER \ NS_IMETHOD Start(NSSCMSContentCallback cb, void * arg); \ NS_IMETHOD Update(const char *aBuf, PRInt32 aLen); \ NS_IMETHOD Finish(nsICMSMessage **msg); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSICMSDECODER(_to) \ NS_IMETHOD Start(NSSCMSContentCallback cb, void * arg) { return _to Start(cb, arg); } \ NS_IMETHOD Update(const char *aBuf, PRInt32 aLen) { return _to Update(aBuf, aLen); } \ NS_IMETHOD Finish(nsICMSMessage **msg) { return _to Finish(msg); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSICMSDECODER(_to) \ NS_IMETHOD Start(NSSCMSContentCallback cb, void * arg) { return !_to ? NS_ERROR_NULL_POINTER : _to->Start(cb, arg); } \ NS_IMETHOD Update(const char *aBuf, PRInt32 aLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->Update(aBuf, aLen); } \ NS_IMETHOD Finish(nsICMSMessage **msg) { return !_to ? NS_ERROR_NULL_POINTER : _to->Finish(msg); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsCMSDecoder : public nsICMSDecoder { public: NS_DECL_ISUPPORTS NS_DECL_NSICMSDECODER nsCMSDecoder(); virtual ~nsCMSDecoder(); /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsCMSDecoder, nsICMSDecoder) nsCMSDecoder::nsCMSDecoder() { NS_INIT_ISUPPORTS(); /* member initializers and constructor code */ } nsCMSDecoder::~nsCMSDecoder() { /* destructor code */ } /* void start (in NSSCMSContentCallback cb, in voidPtr arg); */ NS_IMETHODIMP nsCMSDecoder::Start(NSSCMSContentCallback cb, void * arg) { return NS_ERROR_NOT_IMPLEMENTED; } /* void update (in string aBuf, in long aLen); */ NS_IMETHODIMP nsCMSDecoder::Update(const char *aBuf, PRInt32 aLen) { return NS_ERROR_NOT_IMPLEMENTED; } /* void finish (out nsICMSMessage msg); */ NS_IMETHODIMP nsCMSDecoder::Finish(nsICMSMessage **msg) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif /* starting interface: nsICMSEncoder */ #define NS_ICMSENCODER_IID_STR "a15789aa-8903-462b-81e9-4aa2cff4d5cb" #define NS_ICMSENCODER_IID \ {0xa15789aa, 0x8903, 0x462b, \ { 0x81, 0xe9, 0x4a, 0xa2, 0xcf, 0xf4, 0xd5, 0xcb }} /** * nsICMSEncoder * Interface to Encode an CMS message */ class NS_NO_VTABLE nsICMSEncoder : public nsISupports { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICMSENCODER_IID) /* void start (in nsICMSMessage aMsg, in NSSCMSContentCallback cb, in voidPtr arg); */ NS_IMETHOD Start(nsICMSMessage *aMsg, NSSCMSContentCallback cb, void * arg) = 0; /* void update (in string aBuf, in long aLen); */ NS_IMETHOD Update(const char *aBuf, PRInt32 aLen) = 0; /* void finish (); */ NS_IMETHOD Finish(void) = 0; /* void encode (in nsICMSMessage aMsg); */ NS_IMETHOD Encode(nsICMSMessage *aMsg) = 0; }; /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSICMSENCODER \ NS_IMETHOD Start(nsICMSMessage *aMsg, NSSCMSContentCallback cb, void * arg); \ NS_IMETHOD Update(const char *aBuf, PRInt32 aLen); \ NS_IMETHOD Finish(void); \ NS_IMETHOD Encode(nsICMSMessage *aMsg); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSICMSENCODER(_to) \ NS_IMETHOD Start(nsICMSMessage *aMsg, NSSCMSContentCallback cb, void * arg) { return _to Start(aMsg, cb, arg); } \ NS_IMETHOD Update(const char *aBuf, PRInt32 aLen) { return _to Update(aBuf, aLen); } \ NS_IMETHOD Finish(void) { return _to Finish(); } \ NS_IMETHOD Encode(nsICMSMessage *aMsg) { return _to Encode(aMsg); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSICMSENCODER(_to) \ NS_IMETHOD Start(nsICMSMessage *aMsg, NSSCMSContentCallback cb, void * arg) { return !_to ? NS_ERROR_NULL_POINTER : _to->Start(aMsg, cb, arg); } \ NS_IMETHOD Update(const char *aBuf, PRInt32 aLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->Update(aBuf, aLen); } \ NS_IMETHOD Finish(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Finish(); } \ NS_IMETHOD Encode(nsICMSMessage *aMsg) { return !_to ? NS_ERROR_NULL_POINTER : _to->Encode(aMsg); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsCMSEncoder : public nsICMSEncoder { public: NS_DECL_ISUPPORTS NS_DECL_NSICMSENCODER nsCMSEncoder(); virtual ~nsCMSEncoder(); /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsCMSEncoder, nsICMSEncoder) nsCMSEncoder::nsCMSEncoder() { NS_INIT_ISUPPORTS(); /* member initializers and constructor code */ } nsCMSEncoder::~nsCMSEncoder() { /* destructor code */ } /* void start (in nsICMSMessage aMsg, in NSSCMSContentCallback cb, in voidPtr arg); */ NS_IMETHODIMP nsCMSEncoder::Start(nsICMSMessage *aMsg, NSSCMSContentCallback cb, void * arg) { return NS_ERROR_NOT_IMPLEMENTED; } /* void update (in string aBuf, in long aLen); */ NS_IMETHODIMP nsCMSEncoder::Update(const char *aBuf, PRInt32 aLen) { return NS_ERROR_NOT_IMPLEMENTED; } /* void finish (); */ NS_IMETHODIMP nsCMSEncoder::Finish() { return NS_ERROR_NOT_IMPLEMENTED; } /* void encode (in nsICMSMessage aMsg); */ NS_IMETHODIMP nsCMSEncoder::Encode(nsICMSMessage *aMsg) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #define NS_CMSDECODER_CONTRACTID "@mozilla.org/nsCMSDecoder;1" #define NS_CMSENCODER_CONTRACTID "@mozilla.org/nsCMSEncoder;1" #define NS_CMSMESSAGE_CONTRACTID "@mozilla.org/nsCMSMessage;1" #define NS_HASH_CONTRACTID "@mozilla.org/nsHash;1" /** * CMS specific nsresult error codes */ #define NS_ERROR_CMS_VERIFY_NOT_SIGNED \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_NOT_SIGNED) #define NS_ERROR_CMS_VERIFY_NO_CONTENT_INFO \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_NO_CONTENT_INFO) #define NS_ERROR_CMS_VERIFY_BAD_DIGEST \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_BAD_DIGEST) #define NS_ERROR_CMS_VERIFY_NOCERT \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_NOCERT) #define NS_ERROR_CMS_VERIFY_UNTRUSTED \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_UNTRUSTED) #define NS_ERROR_CMS_VERIFY_ERROR_UNVERIFIED \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_ERROR_UNVERIFIED) #define NS_ERROR_CMS_VERIFY_ERROR_PROCESSING \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_ERROR_PROCESSING) #define NS_ERROR_CMS_VERIFY_BAD_SIGNATURE \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_BAD_SIGNATURE) #define NS_ERROR_CMS_VERIFY_DIGEST_MISMATCH \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_DIGEST_MISMATCH) #define NS_ERROR_CMS_VERIFY_UNKNOWN_ALGO \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_UNKNOWN_ALGO) #define NS_ERROR_CMS_VERIFY_UNSUPPORTED_ALGO \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_UNSUPPORTED_ALGO) #define NS_ERROR_CMS_VERIFY_MALFORMED_SIGNATURE \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_MALFORMED_SIGNATURE) #define NS_ERROR_CMS_VERIFY_HEADER_MISMATCH \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_HEADER_MISMATCH) #define NS_ERROR_CMS_VERIFY_NOT_YET_ATTEMPTED \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::VERIFY_NOT_YET_ATTEMPTED) #define NS_ERROR_CMS_ENCRYPT_NO_BULK_ALG \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, \ nsICMSMessageErrors::ENCRYPT_NO_BULK_ALG) #endif /* __gen_nsICMS_h__ */ .