Missing include.
[libdcp.git] / src / certificates.cc
index 4c41ebba9ab0ff20ea23e8f33fafd45ef01d8093..818d5f7252810840ad8521a896ca71b4a333ae01 100644 (file)
@@ -49,7 +49,7 @@ Certificate::Certificate (boost::filesystem::path filename)
        : _certificate (0)
        , _public_key (0)
 {
-       FILE* f = fopen (filename.c_str(), "r");
+       FILE* f = fopen (filename.string().c_str(), "r");
        if (!f) {
                throw FileError ("could not open file", filename);
        }
@@ -193,6 +193,14 @@ Certificate::subject () const
        return name_for_xml (X509_get_subject_name (_certificate));
 }
 
+string
+Certificate::common_name () const
+{
+       assert (_certificate);
+
+       return get_name_part (X509_get_subject_name (_certificate), NID_commonName);
+}
+
 string
 Certificate::serial () const
 {