Click or drag to resize

Crypt32ManagedAnyToBinary Method

Converts input string to a byte array. See Remarks for more details.

Namespace:  PKI.ManagedAPI
Assembly:  PKI.Core (in PKI.Core.dll) Version: 3.3.0.0 (3.3.0.0)
Syntax
public static byte[] AnyToBinary(
	string anyString
)

Parameters

anyString
Type: SystemString
A string encoded in Base64, hex or binary text.

Return Value

Type: Byte
Decoded bytes
Exceptions
ExceptionCondition
Win32ExceptionIf the input string cannot be recognized and/or decoded.
ArgumentNullExceptionInput string is null or empty.
Remarks
This method is used to decode cryptographic messages formatted in various ways, such Base64 with or without headers, hex string, with or without address and ASCII panels or pure binary text.

This method attempts to decode string in the following order:

  • CRYPT_STRING_HEXADDR
  • CRYPT_STRING_HEXASCIIADDR
  • CRYPT_STRING_HEX
  • CRYPT_STRING_HEXRAW
  • CRYPT_STRING_HEXASCII
  • CRYPT_STRING_BASE64HEADER
  • CRYPT_STRING_BASE64
  • CRYPT_STRING_BINARY
See Also