Pkcs12Info.Decode(ReadOnlyMemory<Byte>, Int32, Boolean) 方法

定义

将提供的数据读取为 PKCS#12 PFX,返回内容的对象视图。

public static System.Security.Cryptography.Pkcs.Pkcs12Info Decode (ReadOnlyMemory<byte> encodedBytes, out int bytesConsumed, bool skipCopy = false);
static member Decode : ReadOnlyMemory<byte> * int * bool -> System.Security.Cryptography.Pkcs.Pkcs12Info
Public Shared Function Decode (encodedBytes As ReadOnlyMemory(Of Byte), ByRef bytesConsumed As Integer, Optional skipCopy As Boolean = false) As Pkcs12Info

参数

encodedBytes
ReadOnlyMemory<Byte>

要解释为 PKCS#12 PFX 的数据。

bytesConsumed
Int32

此方法返回时,包含一个指示 encodedBytes 中的字节数量的值(由此方法读取)。 该参数未经初始化即被处理。

skipCopy
Boolean

true 表示存储 encodedBytes 而不进行防御性复制;否则为 false。 默认值为 false

返回

Pkcs12Info

从输入中解码的 PKCS#12 PFX 的对象视图。

例外

encodedBytes 参数的内容未成功解码为 PKCS#12 PFX。

注解

此方法的默认行为是从encodedBytes中生成第一个bytesConsumed字节的防御副本。 skipCopy参数为true时,将跳过此防御复制。 如果跳过防御副本,并在返回的值的生存期内或由其方法或属性生成的任何对象的第一 bytesConsumed 个字节 encodedBytes 的内容,则这些对象的方法和属性可能会产生无稽结果或由于损坏状态而引发异常。 因此,建议调用方仅在可以合理地确保数据保持不变时,才对参数使用 trueskipCopy

适用于