public void Execute(T command)
        {
            decoratedHandler.Execute(command);
            string keyContent = encoding.GetString(command.FileContent);

            if (!keyContent.StartsWith("-----BEGIN P", StringComparison.InvariantCulture) &&
                !keyContent.StartsWith("-----BEGIN ENCRYPTED", StringComparison.InvariantCulture))
            {
                return;
            }

            command.Result = formattingProvider.GetAsDer(keyContent);
            command.OriginalContentType = ContentType.Pem;
        }
Ejemplo n.º 2
0
        public void Execute(T command)
        {
            decoratedCommandHandler.Execute(command);

            if (command.Result != null)
            {
                return;
            }

            string keyContent = encoding.GetString(command.FileContent);

            if (!keyContent.StartsWith("-----BEGIN EC PRIVATE KEY", StringComparison.InvariantCulture))
            {
                return;
            }

            command.Result = pemFormatter.GetAsDer(keyContent);
            command.OriginalContentType = ContentType.Sec1;
        }