Panda3D

Loading...
Searching...
No Matches
Typedefs | Functions
makePrcKey.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

`#include "dtoolbase.h"`
`#include "prcKeyRegistry.h"`
`#include "filename.h"`
`#include "pvector.h"`
`#include "panda_getopt.h"`
`#include "preprocess_argv.h"`
`#include <stdio.h>`
`#include <openssl/rsa.h>`
`#include <openssl/err.h>`
`#include <openssl/pem.h>`
`#include <openssl/rand.h>`
`#include <openssl/bio.h>`

Go to the source code of this file.

## Typedefs
typedef pvector< KeyNumber > | KeyNumbers

## Functions
EVP_PKEY * | generate_key ()
| Generates a new public and private key pair.
int | main (int argc, char **argv)
void | output_c_string (std::ostream &out, const string &string_name, size_t index, BIO *mbio)
| Extracts the data written to the indicated memory bio and writes it to the indicated stream, formatting it to be compiled into a C or C++ program as a string.
void | output_ssl_errors ()
| A convenience function that is itself a wrapper around the OpenSSL convenience function to output the recent OpenSSL errors.
void | usage ()
void | write_private_key (EVP_PKEY *pkey, Filename outfile, int n, time_t now, const char *pp)
| Generates a C++ program that can be used to sign a prc file with the indicated private key into the given output filename.
void | write_public_keys (Filename outfile)
| Writes the list of public keys stored in the PrcKeyRegistry to the indicated output filename as a compilable list of KeyDef entries, suitable for passing to PrcKeyRegistry::record_keys().

## Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
  drose

Date
  2004-10-19

Definition in file makePrcKey.cxx.

## Typedef Documentation

## ◆ KeyNumbers

typedef pvector<KeyNumber> KeyNumbers

Definition at line 42 of file makePrcKey.cxx.

## Function Documentation

## ◆ generate_key()

EVP_PKEY * generate_key | ( |  | ) |

Generates a new public and private key pair.

Definition at line 116 of file makePrcKey.cxx.

References output_ssl_errors().

## ◆ main()

int main | ( | int | argc,
|  | char ** | argv )

Definition at line 325 of file makePrcKey.cxx.

## ◆ output_c_string()

void output_c_string | ( | std::ostream & | out,
|  | const string & | string_name,
|  | size_t | index,
|  | BIO * | mbio )

Extracts the data written to the indicated memory bio and writes it to the indicated stream, formatting it to be compiled into a C or C++ program as a string.

Definition at line 75 of file makePrcKey.cxx.

Referenced by write_private_key(), and write_public_keys().

## ◆ output_ssl_errors()

void output_ssl_errors | ( |  | ) |

A convenience function that is itself a wrapper around the OpenSSL convenience function to output the recent OpenSSL errors.

This function sends the error string to cerr.

Definition at line 50 of file makePrcKey.cxx.

Referenced by generate_key(), write_private_key(), and write_public_keys().

## ◆ usage()

void usage | ( |  | ) |

Definition at line 266 of file makePrcKey.cxx.

## ◆ write_private_key()

void write_private_key | ( | EVP_PKEY * | pkey,
|  | Filename | outfile,
|  | int | n,
|  | time_t | now,
|  | const char * | pp )

Generates a C++ program that can be used to sign a prc file with the indicated private key into the given output filename.

Definition at line 210 of file makePrcKey.cxx.

References Filename::get_basename_wo_extension(), Filename::open_write(), output_c_string(), output_ssl_errors(), and Filename::set_text().

## ◆ write_public_keys()

void write_public_keys | ( | Filename | outfile | ) |

Writes the list of public keys stored in the PrcKeyRegistry to the indicated output filename as a compilable list of KeyDef entries, suitable for passing to PrcKeyRegistry::record_keys().

Definition at line 145 of file makePrcKey.cxx.

References Filename::open_write(), output_c_string(), output_ssl_errors(), and Filename::set_text().