/// <summary>
        /// Create an DSAOpenSsl from an existing <see cref="IntPtr"/> whose value is an
        /// existing OpenSSL <c>DSA*</c>.
        /// </summary>
        /// <remarks>
        /// This method will increase the reference count of the <c>DSA*</c>, the caller should
        /// continue to manage the lifetime of their reference.
        /// </remarks>
        /// <param name="handle">A pointer to an OpenSSL <c>DSA*</c></param>
        /// <exception cref="ArgumentException"><paramref name="handle" /> is invalid</exception>
        public DSAOpenSsl(IntPtr handle)
        {
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentException(SR.Cryptography_OpenInvalidHandle, nameof(handle));
            }

            SafeDsaHandle ecKeyHandle = SafeDsaHandle.DuplicateHandle(handle);

            SetKey(ecKeyHandle);
        }
Exemplo n.º 2
0
 internal DSAAndroid(SafeDsaHandle key)
 {
     SetKey(key.DuplicateHandle());
 }