C# 클래스 Com.Aurora.Shared.Helpers.Crypto.CryptoHelper

파일 보기 프로젝트 열기: aurora-lzzp/Aurora-Weather

공개 메소드들

메소드 설명
CipherDecryption ( string strAlgName, Windows.Storage.Streams.IBuffer buffEncrypt, BinaryStringEncoding encoding, CryptographicKey key, Windows.Storage.Streams.IBuffer iniVec = null ) : string

对一段 Buffer 根据指定的算法和密钥解密,如果使用 CBC 算法,还需要初始化向量

CipherEncryption ( string content, string strAlgName, BinaryStringEncoding encoding, CryptographicKey key, Windows.Storage.Streams.IBuffer iniVec = null ) : Windows.Storage.Streams.IBuffer

对字符串依据指定的算法和密钥进行加密,如果使用 CBC 算法,还需要初始化向量

GenerateCBCVector ( string strAlgName ) : Windows.Storage.Streams.IBuffer

生成 CBC 算法初始化向量

GenerateKey ( string strAlgName, uint keyLength ) : CryptographicKey

根据加密算法和长度生成一个对称密钥,现在尚不能导出密钥

ProtectAsync ( string strMsg, string strDescriptor, BinaryStringEncoding encoding ) : Task
ToString ( BinaryStringEncoding encoding, Windows.Storage.Streams.IBuffer buff ) : string
UnprotectAsync ( Windows.Storage.Streams.IBuffer buffProtected, BinaryStringEncoding encoding ) : Task

메소드 상세

CipherDecryption() 공개 정적인 메소드

对一段 Buffer 根据指定的算法和密钥解密,如果使用 CBC 算法,还需要初始化向量
public static CipherDecryption ( string strAlgName, Windows.Storage.Streams.IBuffer buffEncrypt, BinaryStringEncoding encoding, CryptographicKey key, Windows.Storage.Streams.IBuffer iniVec = null ) : string
strAlgName string 算法
buffEncrypt Windows.Storage.Streams.IBuffer 加密缓冲区
encoding BinaryStringEncoding 编码方式
key Windows.Security.Cryptography.Core.CryptographicKey 密钥
iniVec Windows.Storage.Streams.IBuffer 初始化向量
리턴 string

CipherEncryption() 공개 정적인 메소드

对字符串依据指定的算法和密钥进行加密,如果使用 CBC 算法,还需要初始化向量
public static CipherEncryption ( string content, string strAlgName, BinaryStringEncoding encoding, CryptographicKey key, Windows.Storage.Streams.IBuffer iniVec = null ) : Windows.Storage.Streams.IBuffer
content string 源字符串
strAlgName string 加密算法
encoding BinaryStringEncoding 字符串编码方式
key Windows.Security.Cryptography.Core.CryptographicKey 密钥
iniVec Windows.Storage.Streams.IBuffer CBC 初始化向量
리턴 Windows.Storage.Streams.IBuffer

GenerateCBCVector() 공개 정적인 메소드

生成 CBC 算法初始化向量
public static GenerateCBCVector ( string strAlgName ) : Windows.Storage.Streams.IBuffer
strAlgName string
리턴 Windows.Storage.Streams.IBuffer

GenerateKey() 공개 정적인 메소드

根据加密算法和长度生成一个对称密钥,现在尚不能导出密钥
public static GenerateKey ( string strAlgName, uint keyLength ) : CryptographicKey
strAlgName string 算法
keyLength uint 密钥长度
리턴 Windows.Security.Cryptography.Core.CryptographicKey

ProtectAsync() 공개 정적인 메소드

public static ProtectAsync ( string strMsg, string strDescriptor, BinaryStringEncoding encoding ) : Task
strMsg string
strDescriptor string
encoding BinaryStringEncoding
리턴 Task

ToString() 공개 정적인 메소드

public static ToString ( BinaryStringEncoding encoding, Windows.Storage.Streams.IBuffer buff ) : string
encoding BinaryStringEncoding
buff Windows.Storage.Streams.IBuffer
리턴 string

UnprotectAsync() 공개 정적인 메소드

public static UnprotectAsync ( Windows.Storage.Streams.IBuffer buffProtected, BinaryStringEncoding encoding ) : Task
buffProtected Windows.Storage.Streams.IBuffer
encoding BinaryStringEncoding
리턴 Task