X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/80e2389990082500d76eb566d4946be3e786c3ef..d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb:/SecurityTests/clxutils/extractCertFields/extractCertFields.cpp diff --git a/SecurityTests/clxutils/extractCertFields/extractCertFields.cpp b/SecurityTests/clxutils/extractCertFields/extractCertFields.cpp new file mode 100644 index 00000000..6ec190c5 --- /dev/null +++ b/SecurityTests/clxutils/extractCertFields/extractCertFields.cpp @@ -0,0 +1,211 @@ +/* + * Parse a cert, dump its subject name (in normalized DER-encoded form), + * key size, and public key blob to stdout. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define WRITE_NAME_FILE 1 + +/* allow checking various DER encoded fields */ +#define SUBJECT_NAME_OID CSSMOID_X509V1SubjectName /* normalized */ +// #define SUBJECT_NAME_OID CSSMOID_X509V1SubjectNameStd /* non normalized */ + +/* + * Print the contents of a CSSM_DATA, like so: + * + * static const uint8