summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-03-29 12:27:06 +0000
committerRüdiger Timm <rt@openoffice.org>2005-03-29 12:27:06 +0000
commitec22833db2a071032da300aebabac2af2c4a8aaf (patch)
tree2991273e06d48f05ffd0eea7eca0550501ca12d5 /xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
parent58797168765f335907afd2d66b779021f7c92960 (diff)
INTEGRATION: CWS xmlsec10 (1.5.20); FILE MERGED
2005/03/23 09:52:54 mmi 1.5.20.3: idl review Issue number: Submitted by: Reviewed by: 2005/03/16 07:30:21 mt 1.5.20.2: RESYNC: (1.5-1.6); FILE MERGED 2005/03/08 08:26:19 mmi 1.5.20.1: add key usage information Issue number: Submitted by: Reviewed by:
Diffstat (limited to 'xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx')
-rw-r--r--xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx44
1 files changed, 39 insertions, 5 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
index 9ad6c2388163..d4902d783d94 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: x509certificate_nssimpl.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: vg $ $Date: 2005-03-10 18:13:21 $
+ * last change: $Author: rt $ $Date: 2005-03-29 13:27:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -143,7 +143,7 @@ sal_Int16 SAL_CALL X509Certificate_NssImpl :: getVersion() throw ( ::com::sun::s
}
}
-::com::sun::star::util::DateTime SAL_CALL X509Certificate_NssImpl :: getNotBefore() throw ( ::com::sun::star::uno::RuntimeException) {
+::com::sun::star::util::DateTime SAL_CALL X509Certificate_NssImpl :: getNotValidBefore() throw ( ::com::sun::star::uno::RuntimeException) {
if( m_pCert != NULL ) {
SECStatus rv ;
PRTime notBefore ;
@@ -172,7 +172,7 @@ sal_Int16 SAL_CALL X509Certificate_NssImpl :: getVersion() throw ( ::com::sun::s
}
}
-::com::sun::star::util::DateTime SAL_CALL X509Certificate_NssImpl :: getNotAfter() throw ( ::com::sun::star::uno::RuntimeException) {
+::com::sun::star::util::DateTime SAL_CALL X509Certificate_NssImpl :: getNotValidAfter() throw ( ::com::sun::star::uno::RuntimeException) {
if( m_pCert != NULL ) {
SECStatus rv ;
PRTime notAfter ;
@@ -252,7 +252,7 @@ sal_Int16 SAL_CALL X509Certificate_NssImpl :: getVersion() throw ( ::com::sun::s
}
}
-::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > SAL_CALL X509Certificate_NssImpl :: findCertExtension( const ::com::sun::star::uno::Sequence< sal_Int8 >& oid ) throw (::com::sun::star::uno::RuntimeException) {
+::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > SAL_CALL X509Certificate_NssImpl :: findCertificateExtension( const ::com::sun::star::uno::Sequence< sal_Int8 >& oid ) throw (::com::sun::star::uno::RuntimeException) {
if( m_pCert != NULL && m_pCert->extensions != NULL ) {
CertificateExtension_XmlSecImpl* pExtn ;
CERTCertExtension** extns ;
@@ -465,5 +465,39 @@ X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Ref
{
return getThumbprint(m_pCert, SEC_OID_MD5);
}
+
+sal_Int32 SAL_CALL X509Certificate_NssImpl::getCertificateUsage( )
+ throw ( ::com::sun::star::uno::RuntimeException)
+{
+ SECStatus rv;
+ SECItem tmpitem;
+ sal_Int32 usage;
+
+ rv = CERT_FindKeyUsageExtension(m_pCert, &tmpitem);
+ if ( rv == SECSuccess )
+ {
+ usage = tmpitem.data[0];
+ PORT_Free(tmpitem.data);
+ tmpitem.data = NULL;
+ }
+ else
+ {
+ usage = KU_ALL;
+ }
+
+ /*
+ * to make the nss implementation compatible with MSCrypto,
+ * the following usage is ignored
+ *
+ *
+ if ( CERT_GovtApprovedBitSet(m_pCert) )
+ {
+ usage |= KU_NS_GOVT_APPROVED;
+ }
+ */
+
+ return usage;
+}
+
// MM : end