public unsafe SecStatusCode RawVerify(SecPadding padding, IntPtr signedData, int signedDataLen, IntPtr signature, int signatureLen) { if (handle == IntPtr.Zero) { throw new ObjectDisposedException("SecKey"); } return(SecKeyRawVerify(handle, padding, signedData, (nint)signedDataLen, signature, (nint)signatureLen)); }
public unsafe SecStatusCode Decrypt(SecPadding padding, IntPtr cipherText, nint cipherTextLen, IntPtr plainText, ref nint plainTextLen) { if (handle == IntPtr.Zero) { throw new ObjectDisposedException("SecKey"); } return(SecKeyDecrypt(handle, padding, cipherText, cipherTextLen, plainText, ref plainTextLen)); }
public unsafe SecStatusCode Encrypt(SecPadding padding, IntPtr plainText, int playLen, IntPtr cipherText, int cipherLen) { if (handle == IntPtr.Zero) { throw new ObjectDisposedException("SecKey"); } return(SecKeyEncrypt(handle, padding, plainText, (IntPtr)playLen, cipherText, (IntPtr)cipherLen)); }
SecStatusCode RawSign(SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { ThrowIfDisposed(); result = new byte [(int)SecKeyGetBlockSize(Handle)]; unsafe { fixed(byte *p = &result[0]) return(SecKeyRawSign(Handle, padding, dataToSign, (IntPtr)dataToSignLen, (IntPtr)p, (IntPtr)result.Length)); } }
public SecStatusCode Decrypt(SecPadding padding, byte [] cipherText, byte [] plainText) { if (plainText == null) { throw new ArgumentNullException("plainText"); } return(_Decrypt(padding, cipherText, ref plainText)); }
SecStatusCode RawSign(SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { if (handle == IntPtr.Zero) { throw new ObjectDisposedException("SecKey"); } result = new byte [(int)SecKeyGetBlockSize(handle)]; unsafe { fixed(byte *p = &result[0]) return(SecKeyRawSign(handle, padding, dataToSign, (IntPtr)dataToSignLen, (IntPtr)p, (IntPtr)result.Length)); } }
public SecStatusCode RawSign(SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { if (handle == IntPtr.Zero) { throw new ObjectDisposedException("SecKey"); } if (dataToSign == IntPtr.Zero) { throw new ArgumentException("dataToSign"); } return(_RawSign(padding, dataToSign, dataToSignLen, out result)); }
SecStatusCode RawSign(SecPadding padding, byte [] dataToSign, out byte [] result) { ThrowIfDisposed(); if (dataToSign == null) { throw new ArgumentNullException("dataToSign"); } result = new byte [(int)SecKeyGetBlockSize(Handle)]; unsafe { fixed(byte *bp = &dataToSign[0]) { fixed(byte *p = &result[0]) return(SecKeyRawSign(Handle, padding, (IntPtr)bp, (IntPtr)dataToSign.Length, (IntPtr)p, (IntPtr)result.Length)); } } }
public SecStatusCode Decrypt(SecPadding padding, byte [] cipherText, byte [] plainText) { ThrowIfDisposed(); if (cipherText == null) { throw new ArgumentNullException("cipherText"); } if (plainText == null) { throw new ArgumentNullException("plainText"); } unsafe { fixed(byte *cp = &cipherText[0]) { fixed(byte *pp = &plainText[0]) { return(SecKeyDecrypt(Handle, padding, (IntPtr)cp, (IntPtr)cipherText.Length, (IntPtr)pp, (IntPtr)plainText.Length)); } } } }
public SecStatusCode RawVerify(SecPadding padding, byte [] signedData, byte [] signature) { ThrowIfDisposed(); if (signature == null) { throw new ArgumentNullException("signature"); } if (signedData == null) { throw new ArgumentNullException("signedData"); } unsafe { fixed(byte *sp = &signature[0]) { fixed(byte *dp = &signedData[0]) { return(SecKeyRawVerify(Handle, padding, (IntPtr)dp, (IntPtr)signedData.Length, (IntPtr)sp, (IntPtr)signature.Length)); } } } }
public SecStatusCode RawVerify(SecPadding padding, byte [] signedData, byte [] signature) { if (handle == IntPtr.Zero) { throw new ObjectDisposedException("SecKey"); } if (signature == null) { throw new ArgumentNullException("signature"); } if (signedData == null) { throw new ArgumentNullException("signedData"); } unsafe { fixed(byte *sp = signature) fixed(byte *dp = signedData) { return(SecKeyRawVerify(handle, padding, (IntPtr)dp, (nint)signedData.Length, (IntPtr)sp, (nint)signature.Length)); } } }
static extern SecStatusCode SecKeyRawSign(IntPtr handle, SecPadding padding, IntPtr dataToSign, IntPtr dataToSignLen, IntPtr sig, IntPtr sigLen);
public SecStatusCode RawVerify(SecPadding padding, byte [] signedData, byte [] signature) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); if (signature == null) throw new ArgumentNullException ("signature"); if (signedData == null) throw new ArgumentNullException ("signedData"); unsafe { fixed (byte *sp = &signature[0]){ fixed (byte *dp = &signedData [0]){ return SecKeyRawVerify (handle, padding, (IntPtr) dp, (IntPtr) signedData.Length, (IntPtr) sp, (IntPtr) signature.Length); } } } }
public SecStatusCode Encrypt(SecPadding padding, byte [] plainText, byte [] cipherText) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); if (cipherText == null) throw new ArgumentNullException ("cipherText"); if (plainText == null) throw new ArgumentNullException ("plainText"); unsafe { fixed (byte *cp = &cipherText[0]){ fixed (byte *pp = &plainText [0]){ return SecKeyEncrypt (handle, padding, (IntPtr) pp, (IntPtr) plainText.Length, (IntPtr) cp, (IntPtr) cipherText.Length); } } } }
extern static SecStatusCode SecKeyDecrypt(IntPtr handle, SecPadding padding, IntPtr cipherTextLen, nint cipherLen, IntPtr plainText, ref nint plainTextLen);
public SecStatusCode Decrypt(SecPadding padding, byte [] cipherText, out byte [] plainText) { plainText = null; return(_Decrypt(padding, cipherText, ref plainText)); }
public SecStatusCode Decrypt (SecPadding padding, byte [] cipherText, byte [] plainText) { ThrowIfDisposed (); if (cipherText == null) throw new ArgumentNullException ("cipherText"); if (plainText == null) throw new ArgumentNullException ("plainText"); unsafe { fixed (byte *cp = &cipherText[0]){ fixed (byte *pp = &plainText [0]){ return SecKeyDecrypt (Handle, padding, (IntPtr) cp, (IntPtr) cipherText.Length, (IntPtr) pp, (IntPtr) plainText.Length); } } } }
SecStatusCode _Decrypt (SecPadding padding, byte [] cipherText, ref byte [] plainText) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); if (cipherText == null) throw new ArgumentNullException ("cipherText"); unsafe { fixed (byte *cp = cipherText) { if (plainText == null) plainText = new byte [cipherText.Length]; nint len = plainText.Length; SecStatusCode status; fixed (byte *pp = plainText) status = SecKeyDecrypt (handle, padding, (IntPtr)cp, (nint)cipherText.Length, (IntPtr)pp, ref len); if (len < plainText.Length) Array.Resize<byte> (ref plainText, (int) len); return status; } } }
SecStatusCode RawSign(SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); result = new byte [(int) SecKeyGetBlockSize (handle)]; unsafe { fixed (byte *p = &result [0]) return SecKeyRawSign (handle, padding, dataToSign, (IntPtr) dataToSignLen, (IntPtr) p, (IntPtr)result.Length); } }
public unsafe SecStatusCode Decrypt(SecPadding padding, IntPtr cipherText, int cipherLen, IntPtr plainText, int playLen) { ThrowIfDisposed(); return(SecKeyDecrypt(Handle, padding, cipherText, (IntPtr)cipherLen, plainText, (IntPtr)playLen)); }
public unsafe SecStatusCode RawVerify(SecPadding padding, IntPtr signedData, int signedDataLen, IntPtr signature, int signatureLen) { ThrowIfDisposed(); return(SecKeyRawVerify(Handle, padding, signedData, (IntPtr)signedDataLen, signature, (IntPtr)signatureLen)); }
public unsafe SecStatusCode RawVerify (SecPadding padding, IntPtr signedData, int signedDataLen, IntPtr signature, int signatureLen) { ThrowIfDisposed (); return SecKeyRawVerify (Handle, padding, signedData, (IntPtr) signedDataLen, signature, (IntPtr) signatureLen); }
public SecStatusCode Decrypt (SecPadding padding, byte [] cipherText, out byte [] plainText) { plainText = null; return _Decrypt (padding, cipherText, ref plainText); }
public SecStatusCode Decrypt (SecPadding padding, byte [] cipherText, byte [] plainText) { if (plainText == null) throw new ArgumentNullException ("plainText"); return _Decrypt (padding, cipherText, ref plainText); }
public unsafe SecStatusCode Decrypt (SecPadding padding, IntPtr cipherText, int cipherLen, IntPtr plainText, int playLen) { ThrowIfDisposed (); return SecKeyDecrypt (Handle, padding, cipherText, (IntPtr) cipherLen, plainText, (IntPtr) playLen); }
private static extern SecStatusCode SecKeyDecrypt(IntPtr handle, SecPadding padding, IntPtr cipherText, int cipherTextLen, IntPtr plainText, ref int plainTextLen);
extern static SecStatusCode SecKeyEncrypt(IntPtr handle, SecPadding padding, IntPtr plainText, IntPtr playLen, IntPtr cipherText, IntPtr cipherLen);
private static extern SecStatusCode SecKeyRawSign(IntPtr handle, SecPadding padding, IntPtr dataToSign, int dataToSignLen, IntPtr sig, ref int sigLen);
extern static SecStatusCode SecKeyRawSign(IntPtr handle, SecPadding padding, IntPtr dataToSign, nint dataToSignLen, IntPtr sig, ref nint sigLen);
extern static SecStatusCode SecKeyRawSign (IntPtr handle, SecPadding padding, IntPtr dataToSign, nint dataToSignLen, IntPtr sig, ref nint sigLen);
extern static SecStatusCode SecKeyRawVerify(IntPtr handle, SecPadding padding, IntPtr signedData, nint signedLen, IntPtr sign, nint signLen);
public SecStatusCode RawSign (SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); if (dataToSign == IntPtr.Zero) throw new ArgumentException ("dataToSign"); return _RawSign (padding, dataToSign, dataToSignLen, out result); }
public SecStatusCode Encrypt(SecPadding padding, byte [] plainText, out byte [] cipherText) { cipherText = new byte [BlockSize]; return(Encrypt(padding, plainText, cipherText)); }
public unsafe SecStatusCode RawSign (SecPadding padding, byte [] dataToSign, out byte [] result) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); if (dataToSign == null) throw new ArgumentNullException ("dataToSign"); fixed (byte *bp = dataToSign) return _RawSign (padding, (IntPtr) bp, dataToSign.Length, out result); }
public unsafe SecStatusCode Encrypt(SecPadding padding, IntPtr plainText, int playLen, IntPtr cipherText, int cipherLen) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); return SecKeyEncrypt (handle, padding, plainText, (IntPtr) playLen, cipherText, (IntPtr) cipherLen); }
unsafe SecStatusCode _RawSign (SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { SecStatusCode status; nint len = 1024; result = new byte [len]; fixed (byte *p = result) { status = SecKeyRawSign (handle, padding, dataToSign, dataToSignLen, (IntPtr) p, ref len); Array.Resize (ref result, (int) len); } return status; }
public unsafe SecStatusCode RawVerify(SecPadding padding, IntPtr signedData, int signedDataLen, IntPtr signature, int signatureLen) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); return SecKeyRawVerify (handle, padding, signedData, (IntPtr) signedDataLen, signature, (IntPtr) signatureLen); }
public SecStatusCode Encrypt (SecPadding padding, byte [] plainText, out byte [] cipherText) { cipherText = new byte [BlockSize]; return Encrypt (padding, plainText, cipherText); }
static extern SecStatusCode SecKeyEncrypt(IntPtr handle, SecPadding padding, IntPtr plainText, IntPtr playLen, IntPtr cipherText, IntPtr cipherLen);
extern static SecStatusCode SecKeyDecrypt (IntPtr handle, SecPadding padding, IntPtr cipherTextLen, nint cipherLen, IntPtr plainText, ref nint plainTextLen);
static extern SecStatusCode SecKeyRawVerify(IntPtr handle, SecPadding padding, IntPtr signedData, IntPtr signedLen, IntPtr sign, IntPtr signLen);
public unsafe SecStatusCode Decrypt (SecPadding padding, IntPtr cipherText, nint cipherTextLen, IntPtr plainText, ref nint plainTextLen) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); return SecKeyDecrypt (handle, padding, cipherText, cipherTextLen, plainText, ref plainTextLen); }
SecStatusCode RawSign(SecPadding padding, byte [] dataToSign, out byte [] result) { if (handle == IntPtr.Zero) throw new ObjectDisposedException ("SecKey"); if (dataToSign == null) throw new ArgumentNullException ("dataToSign"); result = new byte [(int) SecKeyGetBlockSize (handle)]; unsafe { fixed (byte *bp = &dataToSign [0]){ fixed (byte *p = &result [0]) return SecKeyRawSign (handle, padding, (IntPtr) bp, (IntPtr)dataToSign.Length, (IntPtr) p, (IntPtr) result.Length); } } }
SecStatusCode RawSign (SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { ThrowIfDisposed (); result = new byte [(int) SecKeyGetBlockSize (Handle)]; unsafe { fixed (byte *p = &result [0]) return SecKeyRawSign (Handle, padding, dataToSign, (IntPtr) dataToSignLen, (IntPtr) p, (IntPtr)result.Length); } }