Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vereign Client Library
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Vereign Client Library
Commits
37f906aa
Commit
37f906aa
authored
5 years ago
by
Gospodin Bodurov
Browse files
Options
Downloads
Patches
Plain Diff
Add java signing service
parent
ec688929
No related branches found
No related tags found
1 merge request
!57
Ssj 1 signing service java initial
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Gopkg.toml
+1
-1
1 addition, 1 deletion
Gopkg.toml
javascript/src/iframe/viamapi-iframe.js
+74
-0
74 additions, 0 deletions
javascript/src/iframe/viamapi-iframe.js
with
75 additions
and
1 deletion
Gopkg.toml
+
1
−
1
View file @
37f906aa
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
# unused-packages = true
# unused-packages = true
[[constraint]]
[[constraint]]
branch
=
"
master
"
branch
=
"
SSJ-1-signing-service-java-initial
"
name
=
"code.vereign.com/code/restful-api"
name
=
"code.vereign.com/code/restful-api"
[prune]
[prune]
...
...
This diff is collapsed.
Click to expand it.
javascript/src/iframe/viamapi-iframe.js
+
74
−
0
View file @
37f906aa
...
@@ -1271,6 +1271,80 @@ const connection = Penpal.connectToParent({
...
@@ -1271,6 +1271,80 @@ const connection = Penpal.connectToParent({
return
encodeResponse
(
"
200
"
,
""
,
"
Document signed
"
);
return
encodeResponse
(
"
200
"
,
""
,
"
Document signed
"
);
},
},
signDocumentJava
:
async
(
passportUUID
,
documentUUID
,
documentContentType
)
=>
{
const
authenticationPublicKey
=
localStorage
.
getItem
(
"
authenticatedIdentity
"
);
if
(
!
authenticationPublicKey
||
!
window
.
loadedIdentities
[
authenticationPublicKey
]
||
!
extendPinCodeTtl
(
authenticationPublicKey
)
)
{
return
encodeResponse
(
"
400
"
,
""
,
"
Identity not authenticated
"
);
}
const
certResponse
=
await
getCertificateForPassport
(
passportUUID
,
true
);
if
(
certResponse
.
code
!==
"
200
"
)
{
return
encodeResponse
(
"
400
"
,
""
,
certResponse
.
status
);
}
const
{
x509Certificate
:
passportCertificate
,
privateKey
:
passportPrivateKey
,
chain
:
passportChain
}
=
certResponse
.
data
;
const
keys
=
await
createOneTimePassportCertificate
(
makeid
()
+
"
-
"
+
passportUUID
,
null
,
passportPrivateKey
,
passportCertificate
);
const
{
privateKeyPEM
:
privateKeyOneTime
,
certificatePEM
:
certificateOneTime
}
=
keys
;
passportChain
.
push
(
passportCertificate
);
passportChain
.
push
(
certificateOneTime
);
const
pdfContentType
=
"
application/pdf
"
;
if
(
documentContentType
!==
pdfContentType
)
{
const
convResponse
=
await
executeRestfulFunction
(
"
private
"
,
window
.
viamApi
,
window
.
viamApi
.
documentConvertDocumentByUUID
,
null
,
documentUUID
,
documentContentType
,
pdfContentType
);
if
(
convResponse
.
code
!==
"
200
"
)
{
return
encodeResponse
(
"
400
"
,
""
,
convResponse
.
status
);
}
}
const
signResponse
=
await
executeRestfulFunction
(
"
private
"
,
window
.
viamApi
,
window
.
viamApi
.
documentSignDocumentJavaService
,
null
,
privateKeyOneTime
,
passportChain
,
passportUUID
,
documentUUID
,
pdfContentType
);
if
(
signResponse
.
code
!==
"
200
"
)
{
return
encodeResponse
(
"
400
"
,
""
,
signResponse
.
status
);
}
return
encodeResponse
(
"
200
"
,
""
,
"
Document signed
"
);
},
documentCreateDocument
:
async
(
passportUUID
,
path
,
contentType
,
title
)
=>
{
documentCreateDocument
:
async
(
passportUUID
,
path
,
contentType
,
title
)
=>
{
const
authenticationPublicKey
=
localStorage
.
getItem
(
const
authenticationPublicKey
=
localStorage
.
getItem
(
"
authenticatedIdentity
"
"
authenticatedIdentity
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment