Exemplo n.º 1
0
        private static void VerifySignature(string publicKeyPath, string signatureFilePath, string[] filePaths)
        {
            bool validUserInput = SigningValidation.Verify(publicKeyPath, signatureFilePath, filePaths);

            if (!validUserInput)
            {
                return;
            }
            signatureFilePath = FilePathValidation.GetSignatureFilePath(signatureFilePath, filePaths);
            bool validSignatureFile = SigningValidation.SignatureFile(signatureFilePath);

            if (!validSignatureFile)
            {
                return;
            }
            byte[] publicKey = AsymmetricKeyValidation.SigningPublicKeyFile(publicKeyPath);
            if (publicKey == null)
            {
                return;
            }
            FileSigning.VerifyFile(signatureFilePath, filePaths[0], publicKey);
        }
Exemplo n.º 2
0
        private static void VerifySignature(char[] encodedPublicKey, string[] filePaths)
        {
            bool validUserInput = SigningValidation.Verify(encodedPublicKey, filePaths);

            if (!validUserInput)
            {
                return;
            }
            string signatureFilePath  = SigningValidation.GetSignatureFilePath(ref filePaths);
            bool   validSignatureFile = SigningValidation.SignatureFile(signatureFilePath, filePaths);

            if (!validSignatureFile)
            {
                return;
            }
            byte[] publicKey = AsymmetricKeyValidation.SigningPublicKeyString(encodedPublicKey);
            if (publicKey == null)
            {
                return;
            }
            FileSigning.VerifyFile(publicKey, signatureFilePath, filePaths[0]);
        }