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
9f2324d2
Commit
9f2324d2
authored
May 12, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verify ooxml file. developing...
parent
6e258b85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
DesktopEditor/xmlsec/src/XmlSignerBase.h
DesktopEditor/xmlsec/src/XmlSignerBase.h
+3
-0
DesktopEditor/xmlsec/src/XmlSigner_mscrypto.h
DesktopEditor/xmlsec/src/XmlSigner_mscrypto.h
+37
-2
No files found.
DesktopEditor/xmlsec/src/XmlSignerBase.h
View file @
9f2324d2
...
@@ -33,6 +33,9 @@ public:
...
@@ -33,6 +33,9 @@ public:
virtual
std
::
string
GetHash
(
std
::
wstring
&
sXmlFile
)
=
0
;
virtual
std
::
string
GetHash
(
std
::
wstring
&
sXmlFile
)
=
0
;
virtual
bool
Verify
(
std
::
string
&
sXml
,
std
::
string
&
sXmlSignature
)
=
0
;
virtual
bool
Verify
(
std
::
string
&
sXml
,
std
::
string
&
sXmlSignature
)
=
0
;
virtual
bool
LoadFromBase64Data
(
const
std
::
string
&
data
)
=
0
;
virtual
int
ShowCertificate
()
=
0
;
public:
public:
virtual
bool
ShowSelectDialog
()
=
0
;
virtual
bool
ShowSelectDialog
()
=
0
;
};
};
...
...
DesktopEditor/xmlsec/src/XmlSigner_mscrypto.h
View file @
9f2324d2
...
@@ -14,27 +14,40 @@ public:
...
@@ -14,27 +14,40 @@ public:
HCERTSTORE
m_store
;
HCERTSTORE
m_store
;
PCCERT_CONTEXT
m_context
;
PCCERT_CONTEXT
m_context
;
protected:
BYTE
*
m_rawData
;
int
m_rawDataLen
;
public:
public:
CCertificate_mscrypto
()
:
ICertificate
()
CCertificate_mscrypto
()
:
ICertificate
()
{
{
m_store
=
NULL
;
m_store
=
NULL
;
m_context
=
NULL
;
m_context
=
NULL
;
m_rawData
=
NULL
;
m_rawDataLen
=
0
;
}
}
CCertificate_mscrypto
(
PCCERT_CONTEXT
ctx
)
:
ICertificate
()
CCertificate_mscrypto
(
PCCERT_CONTEXT
ctx
)
:
ICertificate
()
{
{
m_store
=
NULL
;
m_store
=
NULL
;
m_context
=
ctx
;
m_context
=
ctx
;
m_rawData
=
NULL
;
m_rawDataLen
=
0
;
}
}
virtual
~
CCertificate_mscrypto
()
virtual
~
CCertificate_mscrypto
()
{
{
if
(
m_store
!=
NULL
)
if
(
m_store
!=
NULL
||
m_rawData
!=
NULL
)
{
{
if
(
NULL
!=
m_context
)
if
(
NULL
!=
m_context
)
CertFreeCertificateContext
(
m_context
);
CertFreeCertificateContext
(
m_context
);
CertCloseStore
(
m_store
,
0
);
RELEASEARRAYOBJECTS
(
m_rawData
);
}
}
if
(
m_store
!=
NULL
)
CertCloseStore
(
m_store
,
0
);
}
}
public:
public:
...
@@ -286,6 +299,28 @@ public:
...
@@ -286,6 +299,28 @@ public:
return
bResultRet
&&
bResult
;
return
bResultRet
&&
bResult
;
}
}
virtual
bool
LoadFromBase64Data
(
const
std
::
string
&
data
)
{
RELEASEARRAYOBJECTS
(
m_rawData
);
if
(
!
NSFile
::
CBase64Converter
::
Decode
(
data
.
c_str
(),
(
int
)
data
.
length
(),
m_rawData
,
m_rawDataLen
))
return
false
;
m_context
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
|
PKCS_7_ASN_ENCODING
,
m_rawData
,
m_rawDataLen
);
if
(
!
m_context
)
{
RELEASEARRAYOBJECTS
(
m_rawData
);
m_rawDataLen
=
0
;
return
false
;
}
return
true
;
}
virtual
int
ShowCertificate
()
{
return
(
int
)
CryptUIDlgViewContext
(
CERT_STORE_CERTIFICATE_CONTEXT
,
m_context
,
NULL
,
NULL
,
0
,
NULL
);
}
public:
public:
virtual
bool
ShowSelectDialog
()
virtual
bool
ShowSelectDialog
()
{
{
...
...
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