Document signing beta

Self allows you to request and manage digital signatures.

For example, you may need a user to digitally sign to indicate their agreement to your terms and conditions.

Plain text signatures

Self allows the signing of arbitrary text as demonstrated below: ARGV[0], terms, [] do |resp|
    puts "Document signature : #{resp.status}"
res := client.DocsService().RequestSignature(os.Args[1], terms, []documents.InputObjects)
let resp = await, terms, [])
console.log(`Document signature : ${resp["status"]}`)

Object based signatures

Self allows the signing of BLOBs (like PDFs). The BLOBs are submitted in the request. The response will contain a list of signed objects.

objects = []'./sample.pdf') do |f|
    objects << {
        name: "Terms and conditions",
        mime: 'application/pdf'
end ARGV[0], terms, objects do |resp|
    if resp.status == 'accepted'
        puts "Document signed!".green
        puts ""
        puts "signed documents: "
        resp.signed_objects.each do |so|
            puts "- Name:  #{so[:name]}"
            puts "  Link:  #{so[:link]}"
            puts "  Hash:  #{so[:hash]}"
        puts ""
        puts "full signature:"
        puts resp.input
        puts "Document signature #{'rejected'.red}"
# Check the full example on:
ds := client.DocsService()
content, err := ioutil.ReadFile("./sample.pdf")
if err != nil {
objects := make([]documents.InputObject, 0)
objects = append(objects, documents.InputObject{
	Name: "Terms and conditions",
	Data: content,
	Mime: "application/pdf",

log.Println("sending document sign request") resp, err := ds.RequestSignature(os.Args[1], "Read and sign this documents", objects) if err != nil { log.Println(err.Error()) } if resp.Status == "accepted" { fmt.Println("Document has been signed") fmt.Println("") fmt.Println("signed documents:") spew.Dump(resp.SignedObjects) for _, o := range resp.SignedObjects { fmt.Println("- Name: " + o.Name) fmt.Println(" Link: " + o.Link) fmt.Println(" Hash: " + o.Hash) } fmt.Println("") fmt.Println("full signature:") fmt.Println(resp.Signature) }

let resp = await, terms, docs)
if (resp["status"] == "accepted") {
  console.log("Document signed!")
  console.log("signned documents: ")
  for (var i=0; i < resp["signed_objects"].length; i++) {
    console.log(`- Name : ${resp["signed_objects"]["name"]}`)
    console.log(`  Link : ${resp["signed_objects"]["link"]}`)
    console.log(`  Hash : ${resp["signed_objects"]["hash"]}`)
  console.log("full signature")

The signed response will contain a SHA256 hash of the original BLOB which can be used to verify the integrity of the document.