X509Certificate2CollectionExtensionsEncode Method |
Encodes existing collection of certificates to ASN.1-encoded byte array.
Namespace:
SysadminsLV.PKI.Utils.CLRExtensions
Assembly:
SysadminsLV.PKI (in SysadminsLV.PKI.dll) Version: 3.7.0.0 (3.7.0.0)
Syntax public static byte[] Encode(
this X509Certificate2Collection collection,
byte enclosingByte = 48
)
<ExtensionAttribute>
Public Shared Function Encode (
collection As X509Certificate2Collection,
Optional enclosingByte As Byte = 48
) As Byte()
public:
[ExtensionAttribute]
static array<unsigned char>^ Encode(
X509Certificate2Collection^ collection,
unsigned char enclosingByte = 48
)
[<ExtensionAttribute>]
static member Encode :
collection : X509Certificate2Collection *
?enclosingByte : byte
(* Defaults:
let _enclosingByte = defaultArg enclosingByte 48
*)
-> byte[]
Parameters
- collection
- Type: System.Security.Cryptography.X509CertificatesX509Certificate2Collection
Extension collection to encode. - enclosingByte (Optional)
- Type: SystemByte
Return Value
Type:
ByteASN.1-encoded byte array.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
X509Certificate2Collection. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions Exception | Condition |
---|
ArgumentNullException | extensions parameter is null. |
Remarks
This method is not the same as
X509Certificate2Collection.Export method and outputs ASN.1-style collection.
See Also