public NSData CreateDecryptedData(SecKeyAlgorithm algorithm, NSData ciphertext, out NSError error) { if (ciphertext == null) { throw new ArgumentNullException(nameof(ciphertext)); } IntPtr err; var data = SecKeyCreateDecryptedData(Handle, algorithm.GetConstant().Handle, ciphertext.Handle, out err); error = err == IntPtr.Zero ? null : new NSError(err); return(Runtime.GetNSObject <NSData> (data, true)); }
public NSData CreateSignature(SecKeyAlgorithm algorithm, NSData dataToSign, out NSError error) { if (dataToSign == null) { throw new ArgumentNullException(nameof(dataToSign)); } IntPtr err; var data = SecKeyCreateSignature(Handle, algorithm.GetConstant().Handle, dataToSign.Handle, out err); error = err == IntPtr.Zero ? null : new NSError(err); return(Runtime.GetNSObject <NSData> (data, true)); }
public bool VerifySignature(SecKeyAlgorithm algorithm, NSData signedData, NSData signature, out NSError error) { if (signedData == null) { throw new ArgumentNullException(nameof(signedData)); } if (signature == null) { throw new ArgumentNullException(nameof(signature)); } IntPtr err; var result = SecKeyVerifySignature(Handle, algorithm.GetConstant().Handle, signedData.Handle, signature.Handle, out err); error = err == IntPtr.Zero ? null : new NSError(err); return(result); }
public bool IsAlgorithmSupported(SecKeyOperationType operation, SecKeyAlgorithm algorithm) { return(SecKeyIsAlgorithmSupported(handle, (int)operation, algorithm.GetConstant().Handle)); }