C# 클래스 SIPSorcery.Sys.Crypto

파일 보기 프로젝트 열기: sipsorcery/sipsorcery

공개 메소드들

메소드 설명
GetHash ( string filepath ) : string

This vesion reads the whole file in at once. This is not great since it can consume a lot of memory if the file is large. However a buffered approach generates diferrent hashes across different platforms.

GetRSAProvider ( string xmlKey ) : RSACryptoServiceProvider
GetRandomByteString ( int byteLength ) : string

Gets an "X2" string representation of a random number.

GetRandomInt ( Int32 minValue, Int32 maxValue ) : Int32
GetRandomInt ( ) : int

Returns a 10 digit random number.

GetRandomInt ( int length ) : int

Returns a random number of a specified length.

GetRandomString ( ) : string
GetRandomString ( int length ) : string
GetRandomUInt ( ) : UInt32
GetRandomUInt16 ( ) : UInt16
GetSHAHash ( ) : byte[]
GetSHAHashAsHex ( ) : string

Returns the hash with each byte as an X2 string. This is useful for situations where the hash needs to only contain safe ASCII characters.

GetSHAHashAsString ( ) : string
RSADecrypt ( string xmlKey, string cypherText ) : string
RSADecryptRaw ( string xmlKey, byte cypher ) : byte[]
RSAEncrypt ( string xmlKey, string plainText ) : string
RSAEncryptRaw ( string xmlKey, string plainText ) : byte[]
SymmetricDecrypt ( string key, string iv, byte cipherBytes ) : string
SymmetricDecrypt ( string key, string iv, string cipherText ) : string
SymmetricEncrypt ( string key, string iv, byte plainTextBytes ) : string
SymmetricEncrypt ( string key, string iv, string plainText ) : string
createRandomSalt ( int length ) : byte[]

비공개 메소드들

메소드 설명
GetFileStream ( string filepath ) : FileStream

Used by methods wishing to perform a hash operation on a file. This method will perform a number of checks and if happy return a read only file stream.

GetFixedLengthByteArray ( string value, int length ) : byte[]

메소드 상세

GetHash() 공개 정적인 메소드

This vesion reads the whole file in at once. This is not great since it can consume a lot of memory if the file is large. However a buffered approach generates diferrent hashes across different platforms.
public static GetHash ( string filepath ) : string
filepath string
리턴 string

GetRSAProvider() 공개 정적인 메소드

public static GetRSAProvider ( string xmlKey ) : RSACryptoServiceProvider
xmlKey string
리턴 System.Security.Cryptography.RSACryptoServiceProvider

GetRandomByteString() 공개 정적인 메소드

Gets an "X2" string representation of a random number.
public static GetRandomByteString ( int byteLength ) : string
byteLength int The byte length of the random number string to obtain.
리턴 string

GetRandomInt() 공개 정적인 메소드

public static GetRandomInt ( Int32 minValue, Int32 maxValue ) : Int32
minValue System.Int32
maxValue System.Int32
리턴 System.Int32

GetRandomInt() 공개 정적인 메소드

Returns a 10 digit random number.
public static GetRandomInt ( ) : int
리턴 int

GetRandomInt() 공개 정적인 메소드

Returns a random number of a specified length.
public static GetRandomInt ( int length ) : int
length int
리턴 int

GetRandomString() 공개 정적인 메소드

public static GetRandomString ( ) : string
리턴 string

GetRandomString() 공개 정적인 메소드

public static GetRandomString ( int length ) : string
length int
리턴 string

GetRandomUInt() 공개 정적인 메소드

public static GetRandomUInt ( ) : UInt32
리턴 System.UInt32

GetRandomUInt16() 공개 정적인 메소드

public static GetRandomUInt16 ( ) : UInt16
리턴 System.UInt16

GetSHAHash() 공개 정적인 메소드

public static GetSHAHash ( ) : byte[]
리턴 byte[]

GetSHAHashAsHex() 공개 정적인 메소드

Returns the hash with each byte as an X2 string. This is useful for situations where the hash needs to only contain safe ASCII characters.
public static GetSHAHashAsHex ( ) : string
리턴 string

GetSHAHashAsString() 공개 정적인 메소드

public static GetSHAHashAsString ( ) : string
리턴 string

RSADecrypt() 공개 정적인 메소드

public static RSADecrypt ( string xmlKey, string cypherText ) : string
xmlKey string
cypherText string
리턴 string

RSADecryptRaw() 공개 정적인 메소드

public static RSADecryptRaw ( string xmlKey, byte cypher ) : byte[]
xmlKey string
cypher byte
리턴 byte[]

RSAEncrypt() 공개 정적인 메소드

public static RSAEncrypt ( string xmlKey, string plainText ) : string
xmlKey string
plainText string
리턴 string

RSAEncryptRaw() 공개 정적인 메소드

public static RSAEncryptRaw ( string xmlKey, string plainText ) : byte[]
xmlKey string
plainText string
리턴 byte[]

SymmetricDecrypt() 공개 정적인 메소드

public static SymmetricDecrypt ( string key, string iv, byte cipherBytes ) : string
key string
iv string
cipherBytes byte
리턴 string

SymmetricDecrypt() 공개 정적인 메소드

public static SymmetricDecrypt ( string key, string iv, string cipherText ) : string
key string
iv string
cipherText string
리턴 string

SymmetricEncrypt() 공개 정적인 메소드

public static SymmetricEncrypt ( string key, string iv, byte plainTextBytes ) : string
key string
iv string
plainTextBytes byte
리턴 string

SymmetricEncrypt() 공개 정적인 메소드

public static SymmetricEncrypt ( string key, string iv, string plainText ) : string
key string
iv string
plainText string
리턴 string

createRandomSalt() 공개 정적인 메소드

public static createRandomSalt ( int length ) : byte[]
length int
리턴 byte[]