Helper function that encodes the given PIN as required by this CardPinControl.

Namespace: CardWerk.SmartCard.Util
Assembly: CardWerk.SmartCard (in CardWerk.SmartCard.dll)

Public Shared Function EncodePin( _ 
ByVal pinEncodingIdentifier As PinEncodingIdentifier, _ 
ByVal pin As String
) As Byte()
This language is not supported or no code example is available.
public static byte[] EncodePin( 
PinEncodingIdentifier pinEncodingIdentifier
string pin 
)
This language is not supported or no code example is available.
public:  
static array< Byte >^ EncodePin( 
PinEncodingIdentifier pinEncodingIdentifier
String^ pin 
)
This language is not supported or no code example is available.
public static function EncodePin( 
pinEncodingIdentifier : PinEncodingIdentifier
pin : String 
) : byte[];
This language is not supported or no code example is available.

Parameters

pinEncodingIdentifier
Type: PinEncodingIdentifier

.

pin
Type: string

The PIN to be encoded.

Return Value

Type: byte[]

Returns a byte array that contains the encoded PIN. The length of the byte array depends on the length of the PIN and the selected encoding. If a BCD encoding is selected, and the PIN has an odd length, then the final nibble will have all bits set.

If the given PIN cannot be encoded, then null is returned.

Exception type Condition

ArgumentNullException

Thrown when one or more required arguments are null.

The given PIN will be checked whether it can be encoded according to the properties of this class. If not, then null will be returned.

.NET Framework

Supported in: 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

.NET Core

Supported in: 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0

.NET Standard

Supported in: 2.0