Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
38ce5586
Commit
38ce5586
authored
Jun 13, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ooxml signing developing...
parent
f6d9ce83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
DesktopEditor/xmlsec/src/include/XmlCertificate.h
DesktopEditor/xmlsec/src/include/XmlCertificate.h
+2
-1
DesktopEditor/xmlsec/src/src/XmlCertificate.cpp
DesktopEditor/xmlsec/src/src/XmlCertificate.cpp
+26
-5
No files found.
DesktopEditor/xmlsec/src/include/XmlCertificate.h
View file @
38ce5586
...
...
@@ -36,6 +36,7 @@ public:
static
int
LoadKey
(
std
::
wstring
file
,
std
::
string
password
);
static
int
LoadCert
(
std
::
wstring
file
,
std
::
string
password
);
static
void
SetOpenSslDialogApplication
(
ICertificateSelectDialogOpenSsl
*
pDialog
);
};
class
Q_DECL_EXPORT
CCertificateInfo
...
...
@@ -131,7 +132,7 @@ public:
public:
static
int
GetOOXMLHashAlg
(
const
std
::
string
&
sAlg
);
static
ICertificate
*
CreateInstance
();
static
ICertificate
*
CreateInstance
();
};
#endif // _XML_SERTIFICATE_BASE_H_
DesktopEditor/xmlsec/src/src/XmlCertificate.cpp
View file @
38ce5586
#ifdef WIN32
#include "./XmlSigner_mscrypto.h"
#define CCertificate CCertificate_mscrypto
int
ICertificateSelectDialogOpenSsl
::
LoadKey
(
std
::
wstring
file
,
std
::
string
password
)
{
return
0
;
}
int
ICertificateSelectDialogOpenSsl
::
LoadCert
(
std
::
wstring
file
,
std
::
string
password
)
{
return
0
;
}
#endif
#if defined(_LINUX) && !defined(_MAC)
...
...
@@ -13,6 +24,16 @@
#define CCertificate CCertificate_openssl
#endif
namespace
{
ICertificateSelectDialogOpenSsl
*
g_application_openssl_gialog
=
NULL
;
}
void
ICertificateSelectDialogOpenSsl
::
SetOpenSslDialogApplication
(
ICertificateSelectDialogOpenSsl
*
pDialog
)
{
g_application_openssl_gialog
=
pDialog
;
}
int
ICertificate
::
GetOOXMLHashAlg
(
const
std
::
string
&
sAlg
)
{
if
(
"http://www.w3.org/2000/09/xmldsig#rsa-sha1"
==
sAlg
||
...
...
@@ -24,25 +45,25 @@ int ICertificate::GetOOXMLHashAlg(const std::string& sAlg)
ICertificate
*
ICertificate
::
CreateInstance
()
{
return
new
CCertificate
();
ICertificate
*
pCert
=
new
CCertificate
();
pCert
->
SetOpenSslDialog
(
g_application_openssl_gialog
);
return
pCert
;
}
CCertificateInfo
ICertificate
::
GetDefault
()
{
CCertificateInfo
info
;
#ifdef WIN32
// detect user name
std
::
wstring
sUserName
;
#ifdef WIN32
DWORD
dwUserNameLen
=
1024
;
wchar_t
*
_name
=
new
wchar_t
[
dwUserNameLen
+
1
];
GetUserNameW
(
_name
,
&
dwUserNameLen
);
sUserName
=
std
::
wstring
(
_name
);
delete
[]
_name
;
#endif
////////////////////
#ifdef WIN32
HANDLE
hStoreHandle
=
CertOpenSystemStoreA
(
NULL
,
"MY"
);
if
(
!
hStoreHandle
)
return
info
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment