]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Added support for Certificate, CRL and PKCS10 encoding to PEM plugin
authorMartin Willi <martin@revosec.ch>
Tue, 13 Jul 2010 11:53:33 +0000 (13:53 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 13 Jul 2010 11:53:33 +0000 (13:53 +0200)
src/libstrongswan/plugins/pem/pem_encoder.c

index 2132016366831b675134acf88aeb4b0d3a174b86..e255d6fd00135409315d90ddfe224f1af4c9c8cd 100644 (file)
@@ -87,6 +87,25 @@ bool pem_encoder_encode(cred_encoding_type_t type, chunk_t *encoding,
                                break;
                        }
                        return FALSE;
+               case CERT_PEM:
+                       if (cred_encoding_args(args, CRED_PART_X509_ASN1_DER,
+                                                                  &asn1, CRED_PART_END))
+                       {       /* PEM encode x509 certificate */
+                               label = "CERTIFICATE";
+                               break;
+                       }
+                       if (cred_encoding_args(args, CRED_PART_X509_CRL_ASN1_DER,
+                                                                  &asn1, CRED_PART_END))
+                       {       /* PEM encode CRL */
+                               label = "X509 CRL";
+                               break;
+                       }
+                       if (cred_encoding_args(args, CRED_PART_PKCS10_ASN1_DER,
+                                                                  &asn1, CRED_PART_END))
+                       {       /* PEM encode PKCS10 certificate reqeuest */
+                               label = "CERTIFICATE REQUEST";
+                               break;
+                       }
                default:
                        return FALSE;
        }