<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Pretty-print some well-known BER or DER encoded data (e.g. certificates,
 * keys, pkcs7)
 */

#include "secutil.h"

#if defined(__sun) && !defined(SVR4)
extern int fprintf(FILE *, char *, ...);
#endif

#include "plgetopt.h"

#include "pk11func.h"
#include "nspr.h"
#include "nss.h"

static void Usage(char *progName)
{
    fprintf(stderr,
	    "Usage:  %s [-t type] [-a] [-i input] [-o output] [-w] [-u]\n",
	    progName);
    fprintf(stderr, "Pretty prints a file containing ASN.1 data in DER or ascii format.\n");
    fprintf(stderr, "%-14s Specify input and display type: %s (sk),\n",
	    "-t type", SEC_CT_PRIVATE_KEY);
    fprintf(stderr, "%-14s %s (pk), %s (c), %s (cr),\n", "", SEC_CT_PUBLIC_KEY,
	    SEC_CT_CERTIFICATE, SEC_CT_CERTIFICATE_REQUEST);
    fprintf(stderr, "%-14s %s (ci), %s (p7), %s or %s (n).\n", "", SEC_CT_CERTIFICATE_ID,
            SEC_CT_PKCS7, SEC_CT_CRL, SEC_CT_NAME);
    fprintf(stderr, "%-14s (Use either the long type name or the shortcut.)\n", "", SEC_CT_CERTIFICATE_ID,
            SEC_CT_PKCS7, SEC_CT_CRL, SEC_CT_NAME);
    fprintf(stderr, "%-14s Input is in ascii encoded form (RFC1113)\n",
	    "-a");
    fprintf(stderr, "%-14s Define an input file to use (default is stdin)\n",
	    "-i input");
    fprintf(stderr, "%-14s Define an output file to use (default is stdout)\n",
	    "-o output");
    fprintf(stderr, "%-14s Don't wrap long output lines\n",
	    "-w");
    fprintf(stderr, "%-14s Use UTF-8 (default is to show non-ascii as .)\n",
	    "-u");
    exit(-1);
}

int main(int argc, char **argv)
{
    int rv, ascii;
    char *progName;
    FILE *outFile;
    PRFileDesc *inFile;
    SECItem der, data;<commit_msg>Bug 1120691 - Fix "too many arguments for format" warning in pp.c. r=kaie<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Pretty-print some well-known BER or DER encoded data (e.g. certificates,
 * keys, pkcs7)
 */

#include "secutil.h"

#if defined(__sun) && !defined(SVR4)
extern int fprintf(FILE *, char *, ...);
#endif

#include "plgetopt.h"

#include "pk11func.h"
#include "nspr.h"
#include "nss.h"

static void Usage(char *progName)
{
    fprintf(stderr,
	    "Usage:  %s [-t type] [-a] [-i input] [-o output] [-w] [-u]\n",
	    progName);
    fprintf(stderr, "Pretty prints a file containing ASN.1 data in DER or ascii format.\n");
    fprintf(stderr, "%-14s Specify input and display type: %s (sk),\n",
	    "-t type", SEC_CT_PRIVATE_KEY);
    fprintf(stderr, "%-14s %s (pk), %s (c), %s (cr),\n", "", SEC_CT_PUBLIC_KEY,
	    SEC_CT_CERTIFICATE, SEC_CT_CERTIFICATE_REQUEST);
    fprintf(stderr, "%-14s %s (ci), %s (p7), %s or %s (n).\n", "", SEC_CT_CERTIFICATE_ID,
            SEC_CT_PKCS7, SEC_CT_CRL, SEC_CT_NAME);
    fprintf(stderr, "%-14s (Use either the long type name or the shortcut.)\n", "");
    fprintf(stderr, "%-14s Input is in ascii encoded form (RFC1113)\n",
	    "-a");
    fprintf(stderr, "%-14s Define an input file to use (default is stdin)\n",
	    "-i input");
    fprintf(stderr, "%-14s Define an output file to use (default is stdout)\n",
	    "-o output");
    fprintf(stderr, "%-14s Don't wrap long output lines\n",
	    "-w");
    fprintf(stderr, "%-14s Use UTF-8 (default is to show non-ascii as .)\n",
	    "-u");
    exit(-1);
}

int main(int argc, char **argv)
{
    int rv, ascii;
    char *progName;
    FILE *outFile;
    PRFileDesc *inFile;
    SECItem der, data;
{'fraction_non_alphanumeric': 0.1641949152542373, 'fraction_numerical': 0.02065677966101695, 'mean_word_length': 3.159691629955947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6361399', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1400, 'n_words': 448}