コード例 #1
0
ファイル: Certificate.cs プロジェクト: masums/xamarin-macios
 public NSData GetKeyExchangeResult(SecKeyAlgorithm algorithm, SecKey publicKey, NSDictionary parameters, out NSError error)
 {
     if (publicKey == null)
     {
         throw new ArgumentNullException(nameof(publicKey));
     }
     if (parameters == null)
         throw new ArgumentNullException(nameof(parameters)); }
コード例 #2
0
ファイル: Certificate.cs プロジェクト: masums/xamarin-macios
        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));
        }
コード例 #3
0
ファイル: Certificate.cs プロジェクト: masums/xamarin-macios
        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));
        }
コード例 #4
0
ファイル: Certificate.cs プロジェクト: masums/xamarin-macios
        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);
        }
コード例 #5
0
ファイル: Certificate.cs プロジェクト: masums/xamarin-macios
 public bool IsAlgorithmSupported(SecKeyOperationType operation, SecKeyAlgorithm algorithm)
 {
     return(SecKeyIsAlgorithmSupported(handle, (int)operation, algorithm.GetConstant().Handle));
 }