1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
5 using System.Security.Cryptography;
7 namespace Internal.Cryptography.Pal.AnyOS
9 internal sealed partial class ManagedPkcsPal : PkcsPal
11 public override Exception CreateRecipientsNotFoundException()
13 return new CryptographicException(SR.Cryptography_Cms_RecipientNotFound);
16 public override Exception CreateRecipientInfosAfterEncryptException()
18 return CreateInvalidMessageTypeException();
21 public override Exception CreateDecryptAfterEncryptException()
23 return CreateInvalidMessageTypeException();
26 public override Exception CreateDecryptTwiceException()
28 return CreateInvalidMessageTypeException();
31 private static Exception CreateInvalidMessageTypeException()
33 // Windows CRYPT_E_INVALID_MSG_TYPE
34 return new CryptographicException(SR.Cryptography_Cms_InvalidMessageType);