C# 클래스 ServiceStack.RsaUtils

Useful .NET Encryption Utils from: https://msdn.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider(v=vs.110).aspx
파일 보기 프로젝트 열기: ServiceStack/ServiceStack 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
DefaultKeyPair RsaKeyPair
DoOAEPPadding bool
KeyLength RsaKeyLengths

공개 메소드들

메소드 설명
Authenticate ( byte dataToSign, RSAParameters privateKey, string hashAlgorithm = "SHA512", RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
CreatePrivateKeyParams ( RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : RSAParameters
CreatePublicAndPrivateKeyPair ( RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : RsaKeyPair
Decrypt ( byte encryptedBytes, RSAParameters privateKey, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
Decrypt ( byte encryptedBytes, string privateKeyXml, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
Decrypt ( string encryptedText, RSAParameters privateKey, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : string
Decrypt ( string encryptedText, string privateKeyXml, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : string
Decrypt ( this text ) : string
Encrypt ( byte bytes, RSAParameters publicKey, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
Encrypt ( byte bytes, string publicKeyXml, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
Encrypt ( string text, RSAParameters publicKey, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : string
Encrypt ( string text, string publicKeyXml, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : string
Encrypt ( this text ) : string
FromPrivateRSAParameters ( this privateKey ) : string
FromPublicRSAParameters ( this publicKey ) : string
ToPrivateKeyXml ( this privateKey ) : string
ToPrivateRSAParameters ( this privateKeyXml ) : RSAParameters
ToPublicKeyXml ( this publicKey ) : string
ToPublicRSAParameters ( this publicKeyXml ) : RSAParameters
ToPublicRsaParameters ( this privateKey ) : RSAParameters
Verify ( byte dataToVerify, byte signature, RSAParameters publicKey, string hashAlgorithm = "SHA512", RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : bool

비공개 메소드들

메소드 설명
CreateRsa ( RsaKeyLengths rsaKeyLength ) : RSA

메소드 상세

Authenticate() 공개 정적인 메소드

public static Authenticate ( byte dataToSign, RSAParameters privateKey, string hashAlgorithm = "SHA512", RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
dataToSign byte
privateKey RSAParameters
hashAlgorithm string
rsaKeyLength RsaKeyLengths
리턴 byte[]

CreatePrivateKeyParams() 공개 정적인 메소드

public static CreatePrivateKeyParams ( RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : RSAParameters
rsaKeyLength RsaKeyLengths
리턴 RSAParameters

CreatePublicAndPrivateKeyPair() 공개 정적인 메소드

public static CreatePublicAndPrivateKeyPair ( RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : RsaKeyPair
rsaKeyLength RsaKeyLengths
리턴 RsaKeyPair

Decrypt() 공개 정적인 메소드

public static Decrypt ( byte encryptedBytes, RSAParameters privateKey, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
encryptedBytes byte
privateKey RSAParameters
rsaKeyLength RsaKeyLengths
리턴 byte[]

Decrypt() 공개 정적인 메소드

public static Decrypt ( byte encryptedBytes, string privateKeyXml, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
encryptedBytes byte
privateKeyXml string
rsaKeyLength RsaKeyLengths
리턴 byte[]

Decrypt() 공개 정적인 메소드

public static Decrypt ( string encryptedText, RSAParameters privateKey, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : string
encryptedText string
privateKey RSAParameters
rsaKeyLength RsaKeyLengths
리턴 string

Decrypt() 공개 정적인 메소드

public static Decrypt ( string encryptedText, string privateKeyXml, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : string
encryptedText string
privateKeyXml string
rsaKeyLength RsaKeyLengths
리턴 string

Decrypt() 공개 정적인 메소드

public static Decrypt ( this text ) : string
text this
리턴 string

Encrypt() 공개 정적인 메소드

public static Encrypt ( byte bytes, RSAParameters publicKey, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
bytes byte
publicKey RSAParameters
rsaKeyLength RsaKeyLengths
리턴 byte[]

Encrypt() 공개 정적인 메소드

public static Encrypt ( byte bytes, string publicKeyXml, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : byte[]
bytes byte
publicKeyXml string
rsaKeyLength RsaKeyLengths
리턴 byte[]

Encrypt() 공개 정적인 메소드

public static Encrypt ( string text, RSAParameters publicKey, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : string
text string
publicKey RSAParameters
rsaKeyLength RsaKeyLengths
리턴 string

Encrypt() 공개 정적인 메소드

public static Encrypt ( string text, string publicKeyXml, RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : string
text string
publicKeyXml string
rsaKeyLength RsaKeyLengths
리턴 string

Encrypt() 공개 정적인 메소드

public static Encrypt ( this text ) : string
text this
리턴 string

FromPrivateRSAParameters() 공개 정적인 메소드

public static FromPrivateRSAParameters ( this privateKey ) : string
privateKey this
리턴 string

FromPublicRSAParameters() 공개 정적인 메소드

public static FromPublicRSAParameters ( this publicKey ) : string
publicKey this
리턴 string

ToPrivateKeyXml() 공개 정적인 메소드

public static ToPrivateKeyXml ( this privateKey ) : string
privateKey this
리턴 string

ToPrivateRSAParameters() 공개 정적인 메소드

public static ToPrivateRSAParameters ( this privateKeyXml ) : RSAParameters
privateKeyXml this
리턴 RSAParameters

ToPublicKeyXml() 공개 정적인 메소드

public static ToPublicKeyXml ( this publicKey ) : string
publicKey this
리턴 string

ToPublicRSAParameters() 공개 정적인 메소드

public static ToPublicRSAParameters ( this publicKeyXml ) : RSAParameters
publicKeyXml this
리턴 RSAParameters

ToPublicRsaParameters() 공개 정적인 메소드

public static ToPublicRsaParameters ( this privateKey ) : RSAParameters
privateKey this
리턴 RSAParameters

Verify() 공개 정적인 메소드

public static Verify ( byte dataToVerify, byte signature, RSAParameters publicKey, string hashAlgorithm = "SHA512", RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : bool
dataToVerify byte
signature byte
publicKey RSAParameters
hashAlgorithm string
rsaKeyLength RsaKeyLengths
리턴 bool

프로퍼티 상세

DefaultKeyPair 공개적으로 정적으로 프로퍼티

public static RsaKeyPair,ServiceStack DefaultKeyPair
리턴 RsaKeyPair

DoOAEPPadding 공개적으로 정적으로 프로퍼티

public static bool DoOAEPPadding
리턴 bool

KeyLength 공개적으로 정적으로 프로퍼티

public static RsaKeyLengths KeyLength
리턴 RsaKeyLengths