From 280d93695523f87a6a76c77f7b323f9676987b7c Mon Sep 17 00:00:00 2001 From: Kyungwook Tak Date: Thu, 18 Aug 2016 14:34:19 +0900 Subject: [PATCH] Use csapi-tizen for get error message API Change-Id: Ibf8e711d1df851d6fbcfcc64e2f588b76af3ba37 Signed-off-by: Kyungwook Tak --- src/Tizen.Security/Interop/Interop.CkmcErrors.cs | 31 +++++++++------------- src/Tizen.Security/Interop/Interop.CkmcTypes.cs | 14 ---------- src/Tizen.Security/Interop/Interop.Libraries.cs | 1 - .../CertificateManager.cs | 12 ++++----- .../Crypto/Cipher.cs | 4 +-- .../Crypto/CipherParameters.cs | 8 +++--- .../Crypto/Signature.cs | 4 +-- .../Tizen.Security.SecureRepository/DataManager.cs | 6 ++--- .../Tizen.Security.SecureRepository/KeyManager.cs | 14 +++++----- .../Tizen.Security.SecureRepository/Manager.cs | 4 +-- .../Tizen.Security.SecureRepository/Pkcs12.cs | 2 +- .../Pkcs12Manager.cs | 4 +-- .../SafeCertificateListHandle.cs | 6 ++--- 13 files changed, 45 insertions(+), 65 deletions(-) diff --git a/src/Tizen.Security/Interop/Interop.CkmcErrors.cs b/src/Tizen.Security/Interop/Interop.CkmcErrors.cs index ce3fe3c..3e12547 100644 --- a/src/Tizen.Security/Interop/Interop.CkmcErrors.cs +++ b/src/Tizen.Security/Interop/Interop.CkmcErrors.cs @@ -15,37 +15,32 @@ */ using System; +using Tizen.Internals.Errors; internal static partial class Interop { private const int TizenErrorKeyManager = -0x01E10000; + private const string LogTag = "Tizen.Security.SecureRepository"; internal enum KeyManagerError : int { - // TODO : Add reference to real Tizen project - //None = Tizen.Internals.Errors.ErrorCode.None, - //InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter - None = 0, // CKMC_ERROR_NONE - InvalidParameter = -22, // CKMC_ERROR_INVALID_PARAMETER + None = ErrorCode.None, + InvalidParameter = ErrorCode.InvalidParameter, VerificationFailed = TizenErrorKeyManager | 0x0D // CKMC_ERROR_VERIFICATION_FAILED }; - internal class KeyManagerExceptionFactory + internal static void CheckNThrowException(int err, string msg) { - internal const string LogTag = "Tizen.Security.SecureRepository"; - - internal static void CheckNThrowException(int err, string msg) + switch (err) { - if (err == (int)KeyManagerError.None) + case (int)KeyManagerError.None: return; - - switch (err) - { - case (int)KeyManagerError.InvalidParameter: - throw new ArgumentException(msg + ", error=" + Interop.GetErrorMessage(err)); - default: - throw new InvalidOperationException(msg + ", error=" + Interop.GetErrorMessage(err)); - } + case (int)KeyManagerError.InvalidParameter: + throw new ArgumentException(string.Format("[{0}] {1}, error={2}", + LogTag, msg, ErrorFacts.GetErrorMessage(err))); + default: + throw new InvalidOperationException(string.Format("[{0}] {1}, error={2}", + LogTag, msg, ErrorFacts.GetErrorMessage(err))); } } } diff --git a/src/Tizen.Security/Interop/Interop.CkmcTypes.cs b/src/Tizen.Security/Interop/Interop.CkmcTypes.cs index 484fac7..42900aa 100644 --- a/src/Tizen.Security/Interop/Interop.CkmcTypes.cs +++ b/src/Tizen.Security/Interop/Interop.CkmcTypes.cs @@ -108,14 +108,6 @@ internal static partial class Interop public readonly IntPtr caChain; } - - static public string GetErrorMessage(int errorCode) - { - IntPtr errorPtr = CkmcTypes.GetErrorMessage(errorCode); - return Marshal.PtrToStringAuto(errorPtr); - } - - internal static partial class CkmcTypes { [DllImport(Libraries.KeyManagerClient, EntryPoint = "ckmc_key_free", CallingConvention = CallingConvention.Cdecl)] @@ -217,11 +209,5 @@ internal static partial class Interop [DllImport(Libraries.KeyManagerClient, EntryPoint = "ckmc_generate_new_params", CallingConvention = CallingConvention.Cdecl)] public static extern int CkmcGenerateNewParam(int algoType, out IntPtr paramList); // int ckmc_generate_new_params(ckmc_algo_type_e type, ckmc_param_list_h *pparams); - - [DllImport(Libraries.TizenBaseCommon, EntryPoint = "get_error_message", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr GetErrorMessage(int err); - // char *get_error_message(int err); - } } - diff --git a/src/Tizen.Security/Interop/Interop.Libraries.cs b/src/Tizen.Security/Interop/Interop.Libraries.cs index a12b370..0405bb8 100644 --- a/src/Tizen.Security/Interop/Interop.Libraries.cs +++ b/src/Tizen.Security/Interop/Interop.Libraries.cs @@ -20,6 +20,5 @@ internal static partial class Interop { public const string Privilege = "libprivilege-info.so.1"; public const string KeyManagerClient = "libkey-manager-client.so.1"; - public const string TizenBaseCommon = "libcapi-base-common.so.0"; } } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/CertificateManager.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/CertificateManager.cs index 6d1e7aa..6b19f00 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/CertificateManager.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/CertificateManager.cs @@ -37,7 +37,7 @@ namespace Tizen.Security.SecureRepository IntPtr ptr = new IntPtr(); int ret = Interop.CkmcManager.CkmcGetCert(alias, password, out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get certificate. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to get certificate. alias=" + alias); return new Certificate(ptr); } @@ -50,7 +50,7 @@ namespace Tizen.Security.SecureRepository { IntPtr ptr = new IntPtr(); int ret = Interop.CkmcManager.CkmcGetCertAliasList(out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get certificate aliases."); + Interop.CheckNThrowException(ret, "Failed to get certificate aliases."); return new SafeAliasListHandle(ptr).Aliases; } @@ -64,7 +64,7 @@ namespace Tizen.Security.SecureRepository static public void SaveCertificate(string alias, Certificate cert, Policy policy) { int ret = Interop.CkmcManager.CkmcSaveCert(alias, cert.ToCkmcCert(), policy.ToCkmcPolicy()); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to save certificate. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to save certificate. alias=" + alias); } /// @@ -83,7 +83,7 @@ namespace Tizen.Security.SecureRepository int ret = Interop.CkmcManager.CkmcGetCertChain(new PinnedObject(certificate.ToCkmcCert()), untrustedCerts.ToCkmcCertificateListPtr(), out ptrCertChain); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get certificate chain"); + Interop.CheckNThrowException(ret, "Failed to get certificate chain"); SafeCertificateListHandle certChain = new SafeCertificateListHandle(ptrCertChain); return certChain.Certificates; @@ -109,7 +109,7 @@ namespace Tizen.Security.SecureRepository int ret = Interop.CkmcManager.CkmcGetCertChainWithTrustedCerts(new PinnedObject(certificate.ToCkmcCert()), untrustedCerts.ToCkmcCertificateListPtr(), trustedCerts.ToCkmcCertificateListPtr(), useTrustedSystemCertificates, out ptrCertChain); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get certificate chain with trusted certificates"); + Interop.CheckNThrowException(ret, "Failed to get certificate chain with trusted certificates"); SafeCertificateListHandle certChain = new SafeCertificateListHandle(ptrCertChain); @@ -126,7 +126,7 @@ namespace Tizen.Security.SecureRepository int ocspStatus = (int)OcspStatus.Good; SafeCertificateListHandle certChain = new SafeCertificateListHandle(certificateChain); int ret = Interop.CkmcManager.CkmcOcspCheck(certChain.ToCkmcCertificateListPtr(), ref ocspStatus); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get certificate chain with trusted certificates"); + Interop.CheckNThrowException(ret, "Failed to get certificate chain with trusted certificates"); return (OcspStatus)ocspStatus; } } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/Cipher.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/Cipher.cs index b559f73..b92e0ff 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/Cipher.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/Cipher.cs @@ -58,7 +58,7 @@ namespace Tizen.Security.SecureRepository.Crypto Interop.CkmcRawBuffer cipherTextBuff = new Interop.CkmcRawBuffer(new PinnedObject(cipherText), cipherText.Length); int ret = Interop.CkmcManager.CkmcDecryptData(Parameters.PtrCkmcParamList, keyAlias, password, cipherTextBuff, out ptrPlainText); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to decrypt data"); + Interop.CheckNThrowException(ret, "Failed to decrypt data"); return new SafeRawBufferHandle(ptrPlainText).Data; } @@ -80,7 +80,7 @@ namespace Tizen.Security.SecureRepository.Crypto Interop.CkmcRawBuffer plainTextBuff = new Interop.CkmcRawBuffer(new PinnedObject(plainText), plainText.Length); int ret = Interop.CkmcManager.CkmcEncryptData(Parameters.PtrCkmcParamList, keyAlias, password, plainTextBuff, out ptrCipherText); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to encrypt data"); + Interop.CheckNThrowException(ret, "Failed to encrypt data"); return new SafeRawBufferHandle(ptrCipherText).Data; } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/CipherParameters.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/CipherParameters.cs index d7d233a..61a3362 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/CipherParameters.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/CipherParameters.cs @@ -43,7 +43,7 @@ namespace Tizen.Security.SecureRepository.Crypto protected void Add(CipherParameterName name, long value) { int ret = Interop.CkmcTypes.CkmcParamListSetInteger(PtrCkmcParamList, (int)name, value); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to add parameter."); + Interop.CheckNThrowException(ret, "Failed to add parameter."); } /// @@ -55,7 +55,7 @@ namespace Tizen.Security.SecureRepository.Crypto { Interop.CkmcRawBuffer rawBuff = new Interop.CkmcRawBuffer(new PinnedObject(value), value.Length); int ret = Interop.CkmcTypes.CkmcParamListSetBuffer(PtrCkmcParamList, (int)name, new PinnedObject(rawBuff)); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to add parameter."); + Interop.CheckNThrowException(ret, "Failed to add parameter."); } /// @@ -66,7 +66,7 @@ namespace Tizen.Security.SecureRepository.Crypto { long value = 0; int ret = Interop.CkmcTypes.CkmcParamListGetInteger(PtrCkmcParamList, (int)name, out value); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get parameter."); + Interop.CheckNThrowException(ret, "Failed to get parameter."); return value; } @@ -79,7 +79,7 @@ namespace Tizen.Security.SecureRepository.Crypto IntPtr ptr = new IntPtr(); int ret = Interop.CkmcTypes.CkmcParamListGetBuffer(PtrCkmcParamList, (int)name, out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get parameter."); + Interop.CheckNThrowException(ret, "Failed to get parameter."); return new SafeRawBufferHandle(ptr).Data; } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/Signature.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/Signature.cs index 9f2e2d4..cdb295b 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/Signature.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/Crypto/Signature.cs @@ -72,7 +72,7 @@ namespace Tizen.Security.SecureRepository.Crypto int ret = Interop.CkmcManager.CkmcCreateSignature(privateKeyAlias, password, messageBuff, hash, rsaPadding, out ptrSignature); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to generate signature"); + Interop.CheckNThrowException(ret, "Failed to generate signature"); return new SafeRawBufferHandle(ptrSignature).Data; } @@ -110,7 +110,7 @@ namespace Tizen.Security.SecureRepository.Crypto signatureBuff, hash, rsaPadding); if (ret == (int)Interop.KeyManagerError.VerificationFailed) return false; - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to verify signature"); + Interop.CheckNThrowException(ret, "Failed to verify signature"); return true; } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/DataManager.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/DataManager.cs index 54f1fa7..5e317f6 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/DataManager.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/DataManager.cs @@ -37,7 +37,7 @@ namespace Tizen.Security.SecureRepository IntPtr ptr = new IntPtr(); int ret = Interop.CkmcManager.CkmcGetData(alias, password, out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get certificate. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to get certificate. alias=" + alias); return new SafeRawBufferHandle(ptr).Data; } @@ -50,7 +50,7 @@ namespace Tizen.Security.SecureRepository { IntPtr ptr = new IntPtr(); int ret = Interop.CkmcManager.CkmcGetDataAliasList(out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get data aliases"); + Interop.CheckNThrowException(ret, "Failed to get data aliases"); return new SafeAliasListHandle(ptr).Aliases; } @@ -66,7 +66,7 @@ namespace Tizen.Security.SecureRepository Interop.CkmcRawBuffer rawBuff = new Interop.CkmcRawBuffer(new PinnedObject(data), data.Length); int ret = Interop.CkmcManager.CkmcSaveData(alias, rawBuff, policy.ToCkmcPolicy()); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to save data. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to save data. alias=" + alias); } } } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/KeyManager.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/KeyManager.cs index 0625be5..ede1173 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/KeyManager.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/KeyManager.cs @@ -37,7 +37,7 @@ namespace Tizen.Security.SecureRepository IntPtr ptr = new IntPtr(); int ret = Interop.CkmcManager.CkmcGetKey(alias, password, out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get key. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to get key. alias=" + alias); return new Key(ptr); } @@ -50,7 +50,7 @@ namespace Tizen.Security.SecureRepository { IntPtr ptr = new IntPtr(); int ret = Interop.CkmcManager.CkmcGetKeyAliasList(out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get key aliases."); + Interop.CheckNThrowException(ret, "Failed to get key aliases."); return new SafeAliasListHandle(ptr).Aliases; } @@ -66,7 +66,7 @@ namespace Tizen.Security.SecureRepository static public void SaveKey(string alias, Key key, Policy policy) { int ret = Interop.CkmcManager.CkmcSaveKey(alias, key.ToCkmcKey(), policy.ToCkmcPolicy()); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to save Key. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to save Key. alias=" + alias); } /// @@ -83,7 +83,7 @@ namespace Tizen.Security.SecureRepository { int ret = Interop.CkmcManager.CkmcCreateKeyPairRsa(size, privateKeyAlias, publicKeyAlias, privateKeyPolicy.ToCkmcPolicy(), publicKeyPolicy.ToCkmcPolicy()); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to Create RSA Key Pair"); + Interop.CheckNThrowException(ret, "Failed to Create RSA Key Pair"); } /// @@ -100,7 +100,7 @@ namespace Tizen.Security.SecureRepository { int ret = Interop.CkmcManager.CkmcCreateKeyPairDsa(size, privateKeyAlias, publicKeyAlias, privateKeyPolicy.ToCkmcPolicy(), publicKeyPolicy.ToCkmcPolicy()); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to Create DSA Key Pair"); + Interop.CheckNThrowException(ret, "Failed to Create DSA Key Pair"); } /// @@ -117,7 +117,7 @@ namespace Tizen.Security.SecureRepository { int ret = Interop.CkmcManager.CkmcCreateKeyPairEcdsa((int)type, privateKeyAlias, publicKeyAlias, privateKeyPolicy.ToCkmcPolicy(), publicKeyPolicy.ToCkmcPolicy()); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to Create ECDSA Key Pair"); + Interop.CheckNThrowException(ret, "Failed to Create ECDSA Key Pair"); } /// @@ -130,7 +130,7 @@ namespace Tizen.Security.SecureRepository static public void CreateKeyAes(int size, string keyAlias, Policy policy) { int ret = Interop.CkmcManager.CkmcCreateKeyAes(size, keyAlias, policy.ToCkmcPolicy()); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to AES Key"); + Interop.CheckNThrowException(ret, "Failed to AES Key"); } } } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/Manager.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/Manager.cs index 2b37acc..1a4bb3f 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/Manager.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/Manager.cs @@ -54,7 +54,7 @@ namespace Tizen.Security.SecureRepository static public void RemoveAlias(string alias) { int ret = Interop.CkmcManager.CkmcRemoveAlias(alias); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to remove alias. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to remove alias. alias=" + alias); } /// @@ -68,7 +68,7 @@ namespace Tizen.Security.SecureRepository static public void SetPermission(string alias, string otherPackageId, int permissions) { int ret = Interop.CkmcManager.CkmcSetPermission(alias, otherPackageId, permissions); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to set permission. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to set permission. alias=" + alias); } } } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/Pkcs12.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/Pkcs12.cs index b32e111..43036e4 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/Pkcs12.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/Pkcs12.cs @@ -38,7 +38,7 @@ namespace Tizen.Security.SecureRepository IntPtr ptr = new IntPtr(); int ret = Interop.CkmcTypes.CkmcPkcs12Load(filePath, filePassword, out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to load PKCS12. file=" + filePath); + Interop.CheckNThrowException(ret, "Failed to load PKCS12. file=" + filePath); return new Pkcs12(ptr); } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/Pkcs12Manager.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/Pkcs12Manager.cs index 5470253..f18585f 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/Pkcs12Manager.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/Pkcs12Manager.cs @@ -39,7 +39,7 @@ namespace Tizen.Security.SecureRepository IntPtr ptr = new IntPtr(); int ret = Interop.CkmcManager.CkmcGetPkcs12(alias, keyPassword, cerificatePassword, out ptr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to get PKCS12. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to get PKCS12. alias=" + alias); return new Pkcs12(ptr); } @@ -58,7 +58,7 @@ namespace Tizen.Security.SecureRepository new PinnedObject(pkcs12.ToCkmcPkcs12()), keyPolicy.ToCkmcPolicy(), certificatePolicy.ToCkmcPolicy()); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to save PKCS12. alias=" + alias); + Interop.CheckNThrowException(ret, "Failed to save PKCS12. alias=" + alias); } } } diff --git a/src/Tizen.Security/Tizen.Security.SecureRepository/SafeCertificateListHandle.cs b/src/Tizen.Security/Tizen.Security.SecureRepository/SafeCertificateListHandle.cs index b346f25..2676759 100644 --- a/src/Tizen.Security/Tizen.Security.SecureRepository/SafeCertificateListHandle.cs +++ b/src/Tizen.Security/Tizen.Security.SecureRepository/SafeCertificateListHandle.cs @@ -68,20 +68,20 @@ namespace Tizen.Security.SecureRepository { IntPtr certPtr; ret = Interop.CkmcTypes.CkmcCertNew(cert.Binary, (uint)cert.Binary.Length, (int)cert.Format, out certPtr); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to create new Certificate."); + Interop.CheckNThrowException(ret, "Failed to create new Certificate."); IntPtr outCertList; if (previous == IntPtr.Zero) { ret = Interop.CkmcTypes.CkmcCertListNew(certPtr, out outCertList); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to create new CertificateList."); + Interop.CheckNThrowException(ret, "Failed to create new CertificateList."); first = outCertList; previous = outCertList; } else { ret = Interop.CkmcTypes.CkmcCertListAdd(previous, certPtr, out outCertList); - Interop.KeyManagerExceptionFactory.CheckNThrowException(ret, "Failed to add Certificate to CertificateList."); + Interop.CheckNThrowException(ret, "Failed to add Certificate to CertificateList."); previous = outCertList; } } -- 2.7.4