C# Класс dlech.SshAgentLib.Util

PageantSharp utility class.
Показать файл Открыть проект

Открытые методы

Метод Описание
ClearByteList ( List list ) : void

writes over all values in list with 0 then call list.Clear()

FromBase64 ( byte base64Data ) : byte[]
FromBase64 ( string base64String ) : byte[]
FromHex ( string base16String ) : byte[]

converts string of hexadecimal characters to a byte[] two characters are converted into one byte

FromHex ( string base16String, string delimeter ) : byte[]

converts string of hexadecimal characters to a byte[] two characters are converted into one byte

GetDataType ( this aConstraint ) : Type

Gets the Type of the Data object for a given Agent.KeyConstraintType

ModMinusOne ( PinnedArray a, PinnedArray b ) : PinnedArray

Computes a % (b -1) of 2 large numbers

ToBase64 ( this binaryData ) : byte[]
ToBytes ( this aInt ) : byte[]

Convert 32 bit integer to four bytes in BigEndian order

ToHexString ( this bytes ) : string

Converts array of bytes to a string of hexadecimal digits delimited by':'. Alpha digits will be lower case.

ToHexString ( this bytes, string delimeter ) : string

Converts array of bytes to a string of hexadecimal digits. Alpha digits will be lower case.

ToInt ( this aBytes ) : UInt32

Converts 4 bytes in BigEndian order to 32 bit integer

ToInt ( this aBytes, int aOffset ) : UInt32

Converts 4 bytes in BigEndian order to 32 bit integer

TrimLeadingZero ( PinnedArray array ) : void

removes leading element from array if the value of that element is 0

UnicodeToAnsi ( this unicodeChar ) : byte

Unicode char to to ANSI char.

Based on http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt

WriteBlob ( this aStream, BlobBuilder aBuilder ) : void

Writes aBuiler data to aStream at current position of aStream

addConfirmConstraint ( this aKeyCollection ) : void

Adds Agent.KeyConstraintType.SSH_AGENT_CONSTRAIN_CONFIRM constraint to key

addLifetimeConstraint ( this aKeyCollection, uint aLifetime ) : void

Adds Agent.KeyConstraintType.SSH_AGENT_CONSTRAIN_LIFETIME constraint to key

Приватные методы

Метод Описание
CompareBigInt ( byte a, byte b, int bShift ) : int

Compares to BigInts

GenericTransform ( ICryptoTransform transform, byte data ) : byte[]
SubtractBigInt ( byte a, byte b, int bShift ) : byte[]

Compute a - b, assumes that a > b<<bShift

Описание методов

ClearByteList() публичный статический Метод

writes over all values in list with 0 then call list.Clear()
public static ClearByteList ( List list ) : void
list List list to be cleared
Результат void

FromBase64() публичный статический Метод

public static FromBase64 ( byte base64Data ) : byte[]
base64Data byte
Результат byte[]

FromBase64() публичный статический Метод

public static FromBase64 ( string base64String ) : byte[]
base64String string
Результат byte[]

FromHex() публичный статический Метод

converts string of hexadecimal characters to a byte[] two characters are converted into one byte
thrown if base16String is null or empty thrown if base16String does not contain an even number of characters /// or if the characters are not hexadecimal digits (0-9 and A-F or a-f)
public static FromHex ( string base16String ) : byte[]
base16String string the string to convert
Результат byte[]

FromHex() публичный статический Метод

converts string of hexadecimal characters to a byte[] two characters are converted into one byte
thrown if base16String is null or empty thrown if base16String does not contain an even number of characters /// or if the characters are not hexadecimal digits (0-9 and A-F or a-f)
public static FromHex ( string base16String, string delimeter ) : byte[]
base16String string the string to convert
delimeter string the delimiter that is present between each pair of digits
Результат byte[]

GetDataType() публичный статический Метод

Gets the Type of the Data object for a given Agent.KeyConstraintType
public static GetDataType ( this aConstraint ) : Type
aConstraint this
Результат System.Type

ModMinusOne() публичный статический Метод

Computes a % (b -1) of 2 large numbers
public static ModMinusOne ( PinnedArray a, PinnedArray b ) : PinnedArray
a PinnedArray variable a
b PinnedArray variable b
Результат PinnedArray

ToBase64() публичный статический Метод

public static ToBase64 ( this binaryData ) : byte[]
binaryData this
Результат byte[]

ToBytes() публичный статический Метод

Convert 32 bit integer to four bytes in BigEndian order
public static ToBytes ( this aInt ) : byte[]
aInt this integer to convert
Результат byte[]

ToHexString() публичный статический Метод

Converts array of bytes to a string of hexadecimal digits delimited by':'. Alpha digits will be lower case.
public static ToHexString ( this bytes ) : string
bytes this the byte[] to convert
Результат string

ToHexString() публичный статический Метод

Converts array of bytes to a string of hexadecimal digits. Alpha digits will be lower case.
public static ToHexString ( this bytes, string delimeter ) : string
bytes this the byte[] to convert
delimeter string a delimiter to insert in-between each pair of digits
Результат string

ToInt() публичный статический Метод

Converts 4 bytes in BigEndian order to 32 bit integer
public static ToInt ( this aBytes ) : UInt32
aBytes this array of bytes
Результат System.UInt32

ToInt() публичный статический Метод

Converts 4 bytes in BigEndian order to 32 bit integer
public static ToInt ( this aBytes, int aOffset ) : UInt32
aBytes this array of bytes
aOffset int the offset where to start reading the bytes
Результат System.UInt32

TrimLeadingZero() публичный статический Метод

removes leading element from array if the value of that element is 0
public static TrimLeadingZero ( PinnedArray array ) : void
array PinnedArray
Результат void

UnicodeToAnsi() публичный статический Метод

Unicode char to to ANSI char.
Based on http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt
public static UnicodeToAnsi ( this unicodeChar ) : byte
unicodeChar this /// Unicode char. ///
Результат byte

WriteBlob() публичный статический Метод

Writes aBuiler data to aStream at current position of aStream
public static WriteBlob ( this aStream, BlobBuilder aBuilder ) : void
aStream this Stream to write to
aBuilder BlobBuilder BlobBuilder to use
Результат void

addConfirmConstraint() публичный статический Метод

Adds Agent.KeyConstraintType.SSH_AGENT_CONSTRAIN_CONFIRM constraint to key
public static addConfirmConstraint ( this aKeyCollection ) : void
aKeyCollection this
Результат void

addLifetimeConstraint() публичный статический Метод

Adds Agent.KeyConstraintType.SSH_AGENT_CONSTRAIN_LIFETIME constraint to key
public static addLifetimeConstraint ( this aKeyCollection, uint aLifetime ) : void
aKeyCollection this
aLifetime uint
Результат void