public CmsSigner(SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, System.Security.Cryptography.AsymmetricAlgorithm privateKey) => throw null;
Beispiel #2
0
 public static byte[] Sign(byte[] content, System.Security.Cryptography.AsymmetricAlgorithm key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.Cose.CoseHeaderMap?protectedHeaders = null, System.Security.Cryptography.Cose.CoseHeaderMap?unprotectedHeaders = null, bool isDetached = false)
 {
     throw null;
 }
Beispiel #3
0
 public bool CheckSignature(System.Security.Cryptography.AsymmetricAlgorithm key)
 {
     throw null;
 }
 public static System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo Create(System.Security.Cryptography.AsymmetricAlgorithm privateKey)
 {
     throw null;
 }
Beispiel #5
0
 public virtual System.Security.Cryptography.AsymmetricSignatureFormatter CreateFormatter(System.Security.Cryptography.AsymmetricAlgorithm key)
 {
     throw null;
 }
Beispiel #6
0
 public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key)
 {
 }
Beispiel #7
0
        private static List <ForwarderConfiguration> GetConfiguration(IBackgroundLogger errorLogger)
        {
            List <ForwarderConfiguration> configs = new List <ForwarderConfiguration>();

            try {
                // Read the XML configuration file.
                XDocument doc;
                using (FileStream fs = new FileStream(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "configuration.xml"), FileMode.Open, FileAccess.Read)) {
                    doc = XDocument.Load(fs);
                }

                XElement root = doc.Root;
                if (root.Name.LocalName == "TcpForwarderConfiguration")
                {
                    foreach (XNode node in root.Nodes())
                    {
                        try {
                            if (node is XElement && ((XElement)node).Name.LocalName == "Forwarder")
                            {
                                // Found an entry.
                                XElement el = (XElement)node;

                                XAttribute remoteHost = el.Attribute("remoteHost");
                                XAttribute remotePort = el.Attribute("remotePort");
                                XAttribute localPort  = el.Attribute("localPort");

                                if (remoteHost == null || remotePort == null || localPort == null)
                                {
                                    throw new ArgumentException("One of the required attributes (maxConcurrentConnections, remoteHost, remotePort, localPort) is missing.");
                                }

                                int        maxConcurrentConnections;
                                XAttribute maxConcurrentConnectionsAttr = el.Attribute("maxConcurrentConnections");
                                if (maxConcurrentConnectionsAttr != null)
                                {
                                    maxConcurrentConnections = int.Parse(maxConcurrentConnectionsAttr.Value, CultureInfo.InvariantCulture);
                                }
                                else
                                {
                                    maxConcurrentConnections = 10000;
                                }

                                string     remoteSslHostname = null;
                                XAttribute at = el.Attribute("remoteSslHostname");
                                if (at != null)
                                {
                                    remoteSslHostname = at.Value;
                                }

                                X509Certificate2 cert = null;
                                at = el.Attribute("localSslCertFingerprint");
                                if (at != null)
                                {
                                    cert = TcpConnectionForwarderUtils.GetCurrentUserOrLocalMachineCertificateFromFingerprint(at.Value);
                                    if (cert == null)
                                    {
                                        throw new Exception("The certificate with fingerprint \"" + at.Value + "\" was not found.");
                                    }

                                    // check if we have enough privileges to get the private key of the certificate (when using the local machine's store,
                                    // the program might need administrative rights to access the private key)
                                    try {
                                        System.Security.Cryptography.AsymmetricAlgorithm am = cert.PrivateKey;
                                        GC.KeepAlive(am); // Ensure the compiler does not optimize-away the above call
                                    } catch (Exception ex) {
                                        if (ExceptionUtils.ShouldExceptionBeRethrown(ex))
                                        {
                                            throw;
                                        }

                                        throw new Exception("Error when retrieving the private key of the certificate. Make sure "
                                                            + "you run this program with correct privileges.\r\n\r\n"
                                                            + ex.GetType().ToString() + ": " + ex.Message, ex);
                                    }
                                }

                                ForwarderConfiguration conf = new ForwarderConfiguration()
                                {
                                    MaxConcurrentConnections = maxConcurrentConnections,
                                    RemoteHost        = remoteHost.Value,
                                    RemotePort        = ushort.Parse(remotePort.Value, CultureInfo.InvariantCulture),
                                    LocalPort         = ushort.Parse(localPort.Value, CultureInfo.InvariantCulture),
                                    RemoteSslHostname = remoteSslHostname,
                                    LocalSslCert      = cert
                                };

                                configs.Add(conf);
                            }
                        } catch (Exception ex) {
                            if (ExceptionUtils.ShouldExceptionBeRethrown(ex))
                            {
                                throw;
                            }

                            errorLogger.LogError("An error occured when parsing the following XML configuration entry:\r\n"
                                                 + node.ToString() + "\r\n\r\nError Details:\r\n" + FormatExceptionForLog(ex));
                        }
                    }
                }
            } catch (Exception ex) {
                if (ExceptionUtils.ShouldExceptionBeRethrown(ex))
                {
                    throw;
                }

                errorLogger.LogError("An error when reading the XML configuration.\r\n\r\nError Details:\r\n" + FormatExceptionForLog(ex));
            }

            return(configs);
        }
Beispiel #8
0
 public RSAPKCS1SignatureDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key)
 {
 }
 public virtual System.Threading.Tasks.Task <Azure.Security.Attestation.AttestationResponse <Azure.Security.Attestation.PolicyResult> > SetPolicyAsync(Azure.Security.Attestation.AttestationType attestationType, string policyToSet, System.Security.Cryptography.AsymmetricAlgorithm signingKey = null, System.Security.Cryptography.X509Certificates.X509Certificate2 signingCertificate = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     throw null;
 }
Beispiel #10
0
 public virtual byte[] Sign(System.Security.Cryptography.AsymmetricAlgorithm aa)
 {
     throw new NotImplementedException();
 }
 public SecuredAttestationToken(System.Security.Cryptography.AsymmetricAlgorithm signingKey, System.Security.Cryptography.X509Certificates.X509Certificate2 signingCertificate)
 {
 }
 public virtual System.Threading.Tasks.Task <Azure.Security.Attestation.AttestationResponse <Azure.Security.Attestation.PolicyCertificatesModificationResult> > RemovePolicyManagementCertificateAsync(System.Security.Cryptography.X509Certificates.X509Certificate2 certificateToRemove, System.Security.Cryptography.AsymmetricAlgorithm existingSigningKey, System.Security.Cryptography.X509Certificates.X509Certificate2 existingSigningCertificate, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     throw null;
 }
Beispiel #13
0
 public bool CheckSignatureReturningKey(out System.Security.Cryptography.AsymmetricAlgorithm signingKey)
 {
     throw null;
 }
Beispiel #14
0
 public RSAOAEPKeyExchangeDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key)
 {
 }
 public void Decrypt(System.Security.Cryptography.Pkcs.RecipientInfo recipientInfo, System.Security.Cryptography.AsymmetricAlgorithm privateKey)
 {
 }
Beispiel #16
0
 public RSAPKCS1KeyExchangeFormatter(System.Security.Cryptography.AsymmetricAlgorithm key)
 {
 }
 public System.Security.Cryptography.Pkcs.Pkcs12KeyBag AddKeyUnencrypted(System.Security.Cryptography.AsymmetricAlgorithm key)
 {
     throw null;
 }
Beispiel #18
0
 public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key);
 public System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag AddShroudedKey(System.Security.Cryptography.AsymmetricAlgorithm key, System.ReadOnlySpan <byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters)
 {
     throw null;
 }
Beispiel #20
0
 public DSASignatureFormatter(System.Security.Cryptography.AsymmetricAlgorithm key)
 {
 }
 public System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag AddShroudedKey(System.Security.Cryptography.AsymmetricAlgorithm key, string password, System.Security.Cryptography.PbeParameters pbeParameters)
 {
     throw null;
 }
Beispiel #22
0
 public bool VerifySignature(System.Security.Cryptography.AsymmetricAlgorithm aa)
 {
     throw new NotImplementedException();
 }
Beispiel #23
0
 public AttestationTokenSigningKey(System.Security.Cryptography.AsymmetricAlgorithm signer, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)
 {
 }