/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "rsautil.h"

int
main(int argc, char* argv[])
{
    FILE* fptr1;
    FILE* fptr2;

    if( argc < 3){
        fprintf(stderr, "Usage: %s  inputfile.pem outputfile.rsa\n", argv[0]);
        exit(1);
    }
    fptr1 = fopen(argv[1], "rb");
    if(fptr1 ==0){
        fprintf(stderr, "Input file not found\n");
        exit(1);
    }
    fptr2 = fopen(argv[2], "wb");
    if(fptr2 ==0){
        fprintf(stderr, "Output file could not open\n");
        exit(1);
    }
    RUTIL_ConvertPem(fptr1, fptr2);
    fclose(fptr1);
    fclose(fptr2);

    return 0;
}
