Exemplo n.º 1
0
                public void DifferentParameters_ShouldReturn_False()
                {
                    // Arrange
                    var certificate1 = new RsaCertificate(parameters: ScenarioRsa1.RsaParameters);
                    var certificate2 = new RsaCertificate(parameters: ScenarioRsa2.RsaParameters);

                    // Act
                    // Assert
                    certificate1.Equals(certificate2).Should().BeFalse();
                }
Exemplo n.º 2
0
                public void SameParameters_ShouldReturn_True()
                {
                    // Arrange
                    var certificate1 = new RsaCertificate(parameters: ScenarioRsa1.RsaParameters);
                    var certificate2 = new RsaCertificate(parameters: ScenarioRsa1.RsaParameters);

                    // Act
                    // Assert
                    certificate1.Equals(certificate2).Should().BeTrue();
                }
Exemplo n.º 3
0
                public void DifferentParametersAndSameSignature_ShouldReturn_False()
                {
                    // Arrange
                    var signature    = createRsaSignature();
                    var certificate1 = new RsaCertificate(
                        parameters: ScenarioRsa1.RsaParameters,
                        signature: signature);
                    var certificate2 = new RsaCertificate(
                        parameters: ScenarioRsa2.RsaParameters,
                        signature: signature);

                    // Act
                    // Assert
                    certificate1.Equals(certificate2).Should().BeFalse();
                }
Exemplo n.º 4
0
                public void SameParametersAndSignature_ShouldReturn_True()
                {
                    // Arrange
                    var signature    = new RsaSignature(Sha512Hash.Compute(new byte[] { 0x00 }), new byte[] { 0x01 });
                    var certificate1 = new RsaCertificate(
                        parameters: ScenarioRsa1.RsaParameters,
                        signature: signature);
                    var certificate2 = new RsaCertificate(
                        parameters: ScenarioRsa1.RsaParameters,
                        signature: signature);

                    // Act
                    // Assert
                    certificate1.Equals(certificate2).Should().BeTrue();
                }
Exemplo n.º 5
0
                public void SameParametersAndDifferentSignature_ShouldReturn_False()
                {
                    // Arrange
                    var signature1   = createRsaSignature();
                    var certificate1 = new RsaCertificate(
                        parameters: ScenarioRsa1.RsaParameters,
                        signature: signature1);
                    var signature2 = createRsaSignature(
                        signerCertificateHash: Sha512Hash.Compute(new byte[] { 0x00 }),
                        signature: new byte[] { 0x01 });
                    var certificate2 = new RsaCertificate(
                        parameters: ScenarioRsa1.RsaParameters,
                        signature: signature2);

                    // Act
                    // Assert
                    certificate1.Equals(certificate2).Should().BeFalse();
                }