static private FromCapiPublicKeyBlob ( byte blob, int offset ) : |
||
blob | byte | |
offset | int | |
리턴 |
public static RSA FromCapiKeyBlob(byte[] blob, int offset) { if (blob == null) { throw new ArgumentNullException("blob"); } if (offset >= blob.Length) { throw new ArgumentException("blob is too small."); } byte b = blob[offset]; if (b == 6) { return(CryptoConvert.FromCapiPublicKeyBlob(blob, offset)); } if (b != 7) { if (b == 0) { if (blob[offset + 12] == 6) { return(CryptoConvert.FromCapiPublicKeyBlob(blob, offset + 12)); } } throw new CryptographicException("Unknown blob format."); } return(CryptoConvert.FromCapiPrivateKeyBlob(blob, offset)); }
public static RSA FromCapiKeyBlob(byte[] blob, int offset) { if (blob == null) { throw new ArgumentNullException(nameof(blob)); } if (offset >= blob.Length) { throw new ArgumentException("blob is too small."); } switch (blob[offset]) { case 0: if (blob[offset + 12] == (byte)6) { return(CryptoConvert.FromCapiPublicKeyBlob(blob, offset + 12)); } break; case 6: return(CryptoConvert.FromCapiPublicKeyBlob(blob, offset)); case 7: return(CryptoConvert.FromCapiPrivateKeyBlob(blob, offset)); } throw new CryptographicException("Unknown blob format."); }
public static RSA FromCapiPublicKeyBlob(byte[] blob) { return(CryptoConvert.FromCapiPublicKeyBlob(blob, 0)); }