public void FromXmlString(string xml, ECKeyXmlFormat format)
 {
     if (xml == null)
     {
         throw new ArgumentNullException("xml");
     }
     if (format != ECKeyXmlFormat.Rfc4050)
     {
         throw new ArgumentOutOfRangeException("format");
     }
     this.Key = Rfc4050KeyFormatter.FromXml(xml);
 }
Exemplo n.º 2
0
        public void FromXmlString(string xml, ECKeyXmlFormat format)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            if (format != ECKeyXmlFormat.Rfc4050)
            {
                throw new ArgumentOutOfRangeException("format");
            }

            Key = Rfc4050KeyFormatter.FromXml(xml);
        }
Exemplo n.º 3
0
        public string ToXmlString(ECKeyXmlFormat format)
        {
            Contract.Ensures(Contract.Result <string>() != null);

            if (format != ECKeyXmlFormat.Rfc4050)
            {
                throw new ArgumentOutOfRangeException("format");
            }

            ECParameters ecParams = ExportParameters(false);

            return(Rfc4050KeyFormatter.ToXml(ecParams, isEcdh: false));
        }
Exemplo n.º 4
0
        public void FromXmlString(string xml, ECKeyXmlFormat format)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            if (format != ECKeyXmlFormat.Rfc4050)
            {
                throw new ArgumentOutOfRangeException("format");
            }

            bool         isEcdh;
            ECParameters parameters = Rfc4050KeyFormatter.FromXml(xml, out isEcdh);

            // .NET 4.6.2 allowed ECDsaCng to wrap ECDH keys because of interop with non-Windows PFX files.
            // As a result XML marked as ECDiffieHellman loaded just fine, so no check should be done on the
            // key type.
            ImportParameters(parameters);
        }
Exemplo n.º 5
0
        public void FromXmlString(string xml, ECKeyXmlFormat format)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            if (format != ECKeyXmlFormat.Rfc4050)
            {
                throw new ArgumentOutOfRangeException("format");
            }

            bool         isEcdh;
            ECParameters ecParams = Rfc4050KeyFormatter.FromXml(xml, out isEcdh);

            if (!isEcdh)
            {
                throw new ArgumentException(SR.GetString(SR.Cryptography_ArgECDHRequiresECDHKey), "xml");
            }

            ImportParameters(ecParams);
        }
Exemplo n.º 6
0
 public string ToXmlString(ECKeyXmlFormat format)
 => throw new PlatformNotSupportedException();
Exemplo n.º 7
0
 public void FromXmlString(string xml, ECKeyXmlFormat format)
 => throw new PlatformNotSupportedException();
Exemplo n.º 8
0
 public string ToXmlString(ECKeyXmlFormat format)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public void FromXmlString(string xml, ECKeyXmlFormat format)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 10
0
 public string ToXmlString(ECKeyXmlFormat format)
 {
     throw null;
 }
 public string ToXmlString(ECKeyXmlFormat format)
 {
     if (format != ECKeyXmlFormat.Rfc4050)
     {
         throw new ArgumentOutOfRangeException("format");
     }
     return Rfc4050KeyFormatter.ToXml(this.Key);
 }
 public void FromXmlString(string xml, ECKeyXmlFormat format)
 {
   Contract.Ensures(System.Security.Cryptography.CngAlgorithmGroup.ECDsa == this.Key.AlgorithmGroup);
   Contract.Ensures(this.Key.AlgorithmGroup != null);
 }
    public string ToXmlString(ECKeyXmlFormat format)
    {
      Contract.Ensures(Contract.Result<string>() != null);

      return default(string);
    }
Exemplo n.º 14
0
 public void FromXmlString(string xml, ECKeyXmlFormat format)
 {
     Contract.Ensures(System.Security.Cryptography.CngAlgorithmGroup.ECDsa == this.Key.AlgorithmGroup);
     Contract.Ensures(this.Key.AlgorithmGroup != null);
 }
Exemplo n.º 15
0
        public string ToXmlString(ECKeyXmlFormat format)
        {
            Contract.Ensures(Contract.Result <string>() != null);

            return(default(string));
        }
Exemplo n.º 16
0
        public string ToXmlString(ECKeyXmlFormat format) {
            Contract.Ensures(Contract.Result<string>() != null);

            if (format != ECKeyXmlFormat.Rfc4050) {
                throw new ArgumentOutOfRangeException("format");
            }

            return Rfc4050KeyFormatter.ToXml(Key);
        }
Exemplo n.º 17
0
 public void FromXmlString(string xml, ECKeyXmlFormat format)
 {
     throw null;
 }