Adobe 22002486 Digital Signature User Guide - Page 88

Acrobat 9 Family of Products, Controlling Signing with Seed Values

Page 88 highlights

Acrobat 9 Family of Products Security Feature User Guide Controlling Signing with Seed Values Custom Workflows and Beyond 88 field.borderStyle = border.s; field.fillColor = color.ltGray; //a text field to display what seed values set to the sig field var textField = this.addField("aText", "text",0, [110,360,500,550]); textField.borderStyle = border.s; textField.fillColor = color.yellow; textField.multiline = true; textField.display = display.hidden; //hiden form screen and print textField.setAction("MouseUp", "event.target.display = display.hidden;");//click field, field disappears //3. set seed value //3.1 set up issuer's certificate object var myissuerDN = {CN:"Enterprise Services CA", OU:"VeriSign Trust Network", O:"Example Systems Incorporated"}; var mykeyUsage = ["kDigitalSignature","kCRLSign"]; var myMD5Hash = "BF70 913F F8D6 D60A 47FE 8253, 3081 5DB4"; var mySHA1Hash = "6b e8 46 06 39 f5 65 18 48 b2 f8 3a b1 46 3f 56 02 be 06 c3"; var myserialNumber = "3e 1c bd 28"; var mysubjectCN = "Example Root CA"; var mysubjectDN = {CN:"Example Root CA",OU: "Example Trust Services",O: "Example Systems Incorporated",C:"US"}; var myusage = {endUserSigning:true}; var ExampleRootCertBinary = "308204A130820389A00302010202043E1CBD28300D06092A864886F70D01010505003069310 snip>---------440512D9E9B47DB42A57C1FC2A648B0D7BE92694DA4F62957C5781118DC8751CA13B2629D4F2 B32BD31A5C1FA52AB0588C8"; //var myIssuer = {binary:ExampleRootCertBinary,issuerDN:myissuerDN,keyUsage: mykeyUsage,MD5Hash:myMD5Hash, //SHA1Hash:mySHA1Hash,serialNumber:myserialNumber,subjectCN: mysubjectCN,subjectDN:mysubjectDN,usage:myusage}; var myIssuer = security.importFromFile("Certificate", "/c/test/root.cer");//if import from an external reference // 3.2 set up seed value field.signatureSetSeedValue({reasons:myReasons,certspec:{ issuer: [myIssuer],/*oid:oids,*/url:url,flags:certSpecFlag}, flags:svFlag}); //4. Display seed value added to the signature field to the new text field var result = ""; var w = field.signatureGetSeedValue(); for(i in w) result += ( i + " = " + eval("w." +i) + "\n"); var z = w.certspec; for(i in z) result += ( i + " = " + eval("z." +i) + "\n"); textField.value = result + "** Click on me to make me disappear **"; textField.display = display.show; //display what seed values were set }catch (e){ app.alert("setSeedValues(): " + e ); } }

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189

Acrobat 9 Family of Products
Controlling Signing with Seed Values
Security Feature User Guide
Custom Workflows and Beyond
88
field.borderStyle = border.s;
field.fillColor = color.ltGray;
//a text field to display what seed values set to the sig field
var textField = this.addField("aText", "text",0, [110,360,500,550]);
textField.borderStyle = border.s;
textField.fillColor = color.yellow;
textField.multiline = true;
textField.display = display.hidden;
//hiden form screen and print
textField.setAction("MouseUp", "event.target.display =
display.hidden;");//click field, field disappears
//3. set seed value
//3.1 set
up issuer's certificate object
var myissuerDN = {CN:"Enterprise Services CA", OU:"VeriSign Trust
Network", O:"Example Systems Incorporated"};
var mykeyUsage = ["kDigitalSignature","kCRLSign"];
var myMD5Hash = "BF70 913F F8D6 D60A 47FE 8253, 3081 5DB4";
var mySHA1Hash = "6b e8 46 06 39 f5 65 18 48 b2 f8 3a b1 46 3f 56 02 be 06
c3";
var myserialNumber = "3e 1c bd 28";
var mysubjectCN = "Example Root CA";
var mysubjectDN = {CN:"Example Root CA",OU: "Example Trust Services",O:
"Example Systems Incorporated",C:"US"};
var myusage = {endUserSigning:true};
var ExampleRootCertBinary =
"308204A130820389A00302010202043E1CBD28300D06092A864886F70D01010505003069310
//-----------<snip>----------
440512D9E9B47DB42A57C1FC2A648B0D7BE92694DA4F62957C5781118DC8751CA13B2629D4F2
B32BD31A5C1FA52AB0588C8";
//var myIssuer = {binary:ExampleRootCertBinary,issuerDN:myissuerDN,keyUsage:
mykeyUsage,MD5Hash:myMD5Hash,
//SHA1Hash:mySHA1Hash,serialNumber:myserialNumber,subjectCN:
mysubjectCN,subjectDN:mysubjectDN,usage:myusage};
var myIssuer = security.importFromFile("Certificate",
"/c/test/root.cer");//if import from an external reference
// 3.2 set up seed value
field.signatureSetSeedValue({reasons:myReasons,certspec:{ issuer:
[myIssuer],/*oid:oids,*/url:url,flags:certSpecFlag}, flags:svFlag});
//4. Display seed value added to the signature field to the new text field
var result = "";
var w = field.signatureGetSeedValue();
for(i in w)
result += ( i + " = " + eval("w." +i) + "\n");
var z = w.certspec;
for(i in z)
result += ( i + " = " + eval("z." +i) + "\n");
textField.value = result + "** Click on me to make me disappear **";
textField.display = display.show; //display what seed values were set
}catch (e){
app.alert("setSeedValues(): " + e );
}
}