diff --git a/TameMyCerts/ClassExtensions/CX509CertificateRequestPkcs10Extensions.cs b/TameMyCerts/ClassExtensions/CX509CertificateRequestPkcs10Extensions.cs index a973df2..1eda028 100644 --- a/TameMyCerts/ClassExtensions/CX509CertificateRequestPkcs10Extensions.cs +++ b/TameMyCerts/ClassExtensions/CX509CertificateRequestPkcs10Extensions.cs @@ -61,10 +61,8 @@ public static bool TryInitializeFromInnerRequest(this IX509CertificateRequestPkc try { - certificateRequestCmc.InitializeDecode( - certificateRequest, - EncodingType.XCN_CRYPT_STRING_BASE64_ANY - ); + certificateRequestCmc.InitializeDecode(certificateRequest, + EncodingType.XCN_CRYPT_STRING_BASE64_ANY); var innerRequest = certificateRequestCmc.GetInnerRequest(InnerRequestLevel.LevelInnermost); certificateRequest = innerRequest.get_RawData(); @@ -88,10 +86,8 @@ public static bool TryInitializeFromInnerRequest(this IX509CertificateRequestPkc try { - certificateRequestPkcs7.InitializeDecode( - certificateRequest, - EncodingType.XCN_CRYPT_STRING_BASE64_ANY - ); + certificateRequestPkcs7.InitializeDecode(certificateRequest, + EncodingType.XCN_CRYPT_STRING_BASE64_ANY); var innerRequest = certificateRequestPkcs7.GetInnerRequest(InnerRequestLevel.LevelInnermost); certificateRequest = innerRequest.get_RawData(); @@ -110,10 +106,7 @@ public static bool TryInitializeFromInnerRequest(this IX509CertificateRequestPkc try { - certificateRequestPkcs10.InitializeDecode( - certificateRequest, - EncodingType.XCN_CRYPT_STRING_BASE64_ANY - ); + certificateRequestPkcs10.InitializeDecode(certificateRequest, EncodingType.XCN_CRYPT_STRING_BASE64_ANY); } catch { @@ -127,14 +120,9 @@ public static string GetKeyAlgorithmName(this IX509CertificateRequestPkcs10 cert { switch (certificateRequestPkcs10.PublicKey.Algorithm.Value) { - case WinCrypt.szOID_ECC_PUBLIC_KEY: - return "ECC"; - - case WinCrypt.szOID_RSA_RSA: - return "RSA"; - - default: - return certificateRequestPkcs10.PublicKey.Algorithm.Value; + case WinCrypt.szOID_ECC_PUBLIC_KEY: return "ECC"; + case WinCrypt.szOID_RSA_RSA: return "RSA"; + default: return certificateRequestPkcs10.PublicKey.Algorithm.Value; } } @@ -177,10 +165,6 @@ public static Dictionary GetInlineRequestAttributeList( attributeList.Add("ProcessName", clientId.ProcessName.ToLowerInvariant()); attributeList.Add("MachineDnsName", clientId.MachineDnsName); } - catch - { - // we don't want an exception to be thrown - } finally { Marshal.ReleaseComObject(clientId);