origami-docspring 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/examples/attachments/attachment.rb +7 -8
  4. data/examples/attachments/nested_document.rb +6 -5
  5. data/examples/encryption/encryption.rb +5 -4
  6. data/examples/events/events.rb +7 -6
  7. data/examples/flash/flash.rb +10 -9
  8. data/examples/forms/javascript.rb +14 -13
  9. data/examples/forms/xfa.rb +67 -66
  10. data/examples/javascript/hello_world.rb +6 -5
  11. data/examples/javascript/js_emulation.rb +26 -26
  12. data/examples/loop/goto.rb +12 -11
  13. data/examples/loop/named.rb +17 -16
  14. data/examples/signature/signature.rb +11 -11
  15. data/examples/uri/javascript.rb +25 -24
  16. data/examples/uri/open-uri.rb +5 -4
  17. data/examples/uri/submitform.rb +11 -10
  18. data/lib/origami/3d.rb +330 -334
  19. data/lib/origami/acroform.rb +267 -268
  20. data/lib/origami/actions.rb +266 -278
  21. data/lib/origami/annotations.rb +659 -670
  22. data/lib/origami/array.rb +192 -196
  23. data/lib/origami/boolean.rb +66 -70
  24. data/lib/origami/catalog.rb +360 -363
  25. data/lib/origami/collections.rb +132 -133
  26. data/lib/origami/compound.rb +125 -129
  27. data/lib/origami/destinations.rb +226 -237
  28. data/lib/origami/dictionary.rb +155 -154
  29. data/lib/origami/encryption.rb +967 -923
  30. data/lib/origami/extensions/fdf.rb +270 -275
  31. data/lib/origami/extensions/ppklite.rb +323 -328
  32. data/lib/origami/filespec.rb +170 -173
  33. data/lib/origami/filters/ascii.rb +162 -167
  34. data/lib/origami/filters/ccitt/tables.rb +248 -252
  35. data/lib/origami/filters/ccitt.rb +309 -312
  36. data/lib/origami/filters/crypt.rb +31 -34
  37. data/lib/origami/filters/dct.rb +47 -50
  38. data/lib/origami/filters/flate.rb +57 -60
  39. data/lib/origami/filters/jbig2.rb +50 -53
  40. data/lib/origami/filters/jpx.rb +40 -43
  41. data/lib/origami/filters/lzw.rb +151 -155
  42. data/lib/origami/filters/predictors.rb +250 -255
  43. data/lib/origami/filters/runlength.rb +111 -115
  44. data/lib/origami/filters.rb +319 -325
  45. data/lib/origami/font.rb +173 -177
  46. data/lib/origami/functions.rb +62 -66
  47. data/lib/origami/graphics/colors.rb +203 -208
  48. data/lib/origami/graphics/instruction.rb +79 -81
  49. data/lib/origami/graphics/path.rb +141 -144
  50. data/lib/origami/graphics/patterns.rb +156 -160
  51. data/lib/origami/graphics/render.rb +51 -47
  52. data/lib/origami/graphics/state.rb +144 -142
  53. data/lib/origami/graphics/text.rb +185 -188
  54. data/lib/origami/graphics/xobject.rb +818 -804
  55. data/lib/origami/graphics.rb +25 -26
  56. data/lib/origami/header.rb +63 -65
  57. data/lib/origami/javascript.rb +718 -651
  58. data/lib/origami/linearization.rb +284 -285
  59. data/lib/origami/metadata.rb +156 -135
  60. data/lib/origami/name.rb +98 -100
  61. data/lib/origami/null.rb +49 -51
  62. data/lib/origami/numeric.rb +133 -135
  63. data/lib/origami/obfuscation.rb +180 -182
  64. data/lib/origami/object.rb +634 -631
  65. data/lib/origami/optionalcontent.rb +147 -149
  66. data/lib/origami/outline.rb +46 -48
  67. data/lib/origami/outputintents.rb +76 -77
  68. data/lib/origami/page.rb +637 -596
  69. data/lib/origami/parser.rb +214 -221
  70. data/lib/origami/parsers/fdf.rb +44 -45
  71. data/lib/origami/parsers/pdf/lazy.rb +147 -154
  72. data/lib/origami/parsers/pdf/linear.rb +104 -109
  73. data/lib/origami/parsers/pdf.rb +109 -107
  74. data/lib/origami/parsers/ppklite.rb +44 -46
  75. data/lib/origami/pdf.rb +886 -896
  76. data/lib/origami/reference.rb +116 -120
  77. data/lib/origami/signature.rb +617 -625
  78. data/lib/origami/stream.rb +560 -558
  79. data/lib/origami/string.rb +366 -368
  80. data/lib/origami/template/patterns.rb +50 -52
  81. data/lib/origami/template/widgets.rb +111 -114
  82. data/lib/origami/trailer.rb +153 -157
  83. data/lib/origami/tree.rb +55 -57
  84. data/lib/origami/version.rb +19 -19
  85. data/lib/origami/webcapture.rb +87 -90
  86. data/lib/origami/xfa/config.rb +409 -414
  87. data/lib/origami/xfa/connectionset.rb +113 -117
  88. data/lib/origami/xfa/datasets.rb +38 -42
  89. data/lib/origami/xfa/localeset.rb +33 -37
  90. data/lib/origami/xfa/package.rb +49 -52
  91. data/lib/origami/xfa/pdf.rb +54 -59
  92. data/lib/origami/xfa/signature.rb +33 -37
  93. data/lib/origami/xfa/sourceset.rb +34 -38
  94. data/lib/origami/xfa/stylesheet.rb +35 -39
  95. data/lib/origami/xfa/template.rb +1630 -1634
  96. data/lib/origami/xfa/xdc.rb +33 -37
  97. data/lib/origami/xfa/xfa.rb +132 -123
  98. data/lib/origami/xfa/xfdf.rb +34 -38
  99. data/lib/origami/xfa/xmpmeta.rb +34 -38
  100. data/lib/origami/xfa.rb +50 -53
  101. data/lib/origami/xreftable.rb +462 -462
  102. data/lib/origami.rb +37 -38
  103. data/test/test_actions.rb +22 -20
  104. data/test/test_annotations.rb +54 -52
  105. data/test/test_forms.rb +23 -21
  106. data/test/test_native_types.rb +82 -78
  107. data/test/test_object_tree.rb +25 -24
  108. data/test/test_pages.rb +43 -41
  109. data/test/test_pdf.rb +2 -0
  110. data/test/test_pdf_attachment.rb +23 -21
  111. data/test/test_pdf_create.rb +16 -15
  112. data/test/test_pdf_encrypt.rb +69 -66
  113. data/test/test_pdf_parse.rb +131 -129
  114. data/test/test_pdf_parse_lazy.rb +53 -53
  115. data/test/test_pdf_sign.rb +67 -67
  116. data/test/test_streams.rb +145 -143
  117. data/test/test_xrefs.rb +46 -45
  118. metadata +64 -8
@@ -1,321 +1,320 @@
1
- =begin
2
-
3
- This file is part of Origami, PDF manipulation framework for Ruby
4
- Copyright (C) 2016 Guillaume Delugré.
5
-
6
- Origami is free software: you can redistribute it and/or modify
7
- it under the terms of the GNU Lesser General Public License as published by
8
- the Free Software Foundation, either version 3 of the License, or
9
- (at your option) any later version.
10
-
11
- Origami is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU Lesser General Public License for more details.
15
-
16
- You should have received a copy of the GNU Lesser General Public License
17
- along with Origami. If not, see <http://www.gnu.org/licenses/>.
18
-
19
- =end
1
+ # frozen_string_literal: true
2
+
3
+ #
4
+ # This file is part of Origami, PDF manipulation framework for Ruby
5
+ # Copyright (C) 2016 Guillaume Delugré.
6
+ #
7
+ # Origami is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Lesser General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # Origami is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public License
18
+ # along with Origami. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
20
 
21
21
  module Origami
22
+ class PDF
23
+ #
24
+ # Returns true if the document contains an acrobat form.
25
+ #
26
+ def form?
27
+ self.Catalog.key? :AcroForm
28
+ end
22
29
 
23
- class PDF
24
-
25
- #
26
- # Returns true if the document contains an acrobat form.
27
- #
28
- def form?
29
- self.Catalog.key? :AcroForm
30
- end
31
-
32
- #
33
- # Creates a new AcroForm with specified fields.
34
- #
35
- def create_form(*fields)
36
- acroform = self.Catalog.AcroForm ||= InteractiveForm.new.set_indirect(true)
37
- self.add_fields(*fields)
30
+ #
31
+ # Creates a new AcroForm with specified fields.
32
+ #
33
+ def create_form(*fields)
34
+ acroform = self.Catalog.AcroForm ||= InteractiveForm.new.set_indirect(true)
35
+ add_fields(*fields)
38
36
 
39
- acroform
40
- end
37
+ acroform
38
+ end
41
39
 
42
- #
43
- # Add a field to the Acrobat form.
44
- # _field_:: The Field to add.
45
- #
46
- def add_fields(*fields)
47
- raise TypeError, "Expected Field arguments" unless fields.all? { |f| f.is_a?(Field) }
40
+ #
41
+ # Add a field to the Acrobat form.
42
+ # _field_:: The Field to add.
43
+ #
44
+ def add_fields(*fields)
45
+ raise TypeError, "Expected Field arguments" unless fields.all? { |f| f.is_a?(Field) }
48
46
 
49
- self.Catalog.AcroForm ||= InteractiveForm.new.set_indirect(true)
50
- self.Catalog.AcroForm.Fields ||= []
47
+ self.Catalog.AcroForm ||= InteractiveForm.new.set_indirect(true)
48
+ self.Catalog.AcroForm.Fields ||= []
51
49
 
52
- self.Catalog.AcroForm.Fields.concat(fields)
53
- fields.each do |field| field.set_indirect(true) end
50
+ self.Catalog.AcroForm.Fields.concat(fields)
51
+ fields.each do |field| field.set_indirect(true) end
54
52
 
55
- self
56
- end
53
+ self
54
+ end
57
55
 
58
- #
59
- # Returns an Array of Acroform fields.
60
- #
61
- def fields
62
- self.each_field.to_a
63
- end
56
+ #
57
+ # Returns an Array of Acroform fields.
58
+ #
59
+ def fields
60
+ each_field.to_a
61
+ end
64
62
 
65
- #
66
- # Iterates over each Acroform Field.
67
- #
68
- def each_field
69
- return enum_for(__method__) do
70
- if self.form? and self.Catalog.AcroForm.Fields.is_a?(Array)
71
- self.Catalog.AcroForm.Fields.length
72
- else
73
- 0
74
- end
75
- end unless block_given?
76
-
77
- if self.form? and self.Catalog.AcroForm.Fields.is_a?(Array)
78
- self.Catalog.AcroForm.Fields.each do |field|
79
- yield(field.solve)
80
- end
81
- end
63
+ #
64
+ # Iterates over each Acroform Field.
65
+ #
66
+ def each_field
67
+ unless block_given?
68
+ return enum_for(__method__) do
69
+ if form? && self.Catalog.AcroForm.Fields.is_a?(Array)
70
+ self.Catalog.AcroForm.Fields.length
71
+ else
72
+ 0
73
+ end
82
74
  end
75
+ end
83
76
 
84
- #
85
- # Returns the corresponding named Field.
86
- #
87
- def get_field(name)
88
- self.each_field do |field|
89
- return field if field[:T].solve == name
90
- end
91
-
92
- nil
77
+ if form? && self.Catalog.AcroForm.Fields.is_a?(Array)
78
+ self.Catalog.AcroForm.Fields.each do |field|
79
+ yield(field.solve)
93
80
  end
81
+ end
94
82
  end
95
83
 
96
84
  #
97
- # Class representing a interactive form Dictionary.
85
+ # Returns the corresponding named Field.
98
86
  #
99
- class InteractiveForm < Dictionary
100
- include StandardObject
101
-
102
- #
103
- # Flags relative to signature fields.
104
- #
105
- module SigFlags
106
- SIGNATURES_EXIST = 1 << 0
107
- APPEND_ONLY = 1 << 1
108
- end
87
+ def get_field(name)
88
+ each_field do |field|
89
+ return field if field[:T].solve == name
90
+ end
109
91
 
110
- field :Fields, :Type => Array, :Required => true, :Default => []
111
- field :NeedAppearances, :Type => Boolean, :Default => false
112
- field :SigFlags, :Type => Integer, :Default => 0
113
- field :CO, :Type => Array, :Version => "1.3"
114
- field :DR, :Type => Dictionary
115
- field :DA, :Type => String
116
- field :Q, :Type => Integer
117
- field :XFA, :Type => [ XFAStream, Array.of(String, XFAStream) ]
92
+ nil
118
93
  end
94
+ end
119
95
 
120
- module Field
121
- #
122
- # Types of fields.
123
- #
124
- module Type
125
- BUTTON = :Btn
126
- TEXT = :Tx
127
- CHOICE = :Ch
128
- SIGNATURE = :Sig
129
- end
96
+ #
97
+ # Class representing a interactive form Dictionary.
98
+ #
99
+ class InteractiveForm < Dictionary
100
+ include StandardObject
130
101
 
131
- #
132
- # Flags relative to fields.
133
- #
134
- module Flags
135
- READONLY = 1 << 0
136
- REQUIRED = 1 << 1
137
- NOEXPORT = 1 << 2
138
- end
102
+ #
103
+ # Flags relative to signature fields.
104
+ #
105
+ module SigFlags
106
+ SIGNATURES_EXIST = 1 << 0
107
+ APPEND_ONLY = 1 << 1
108
+ end
139
109
 
140
- module TextAlign
141
- LEFT = 0
142
- CENTER = 1
143
- RIGHT = 2
144
- end
110
+ field :Fields, Type: Array, Required: true, Default: []
111
+ field :NeedAppearances, Type: Boolean, Default: false
112
+ field :SigFlags, Type: Integer, Default: 0
113
+ field :CO, Type: Array, Version: "1.3"
114
+ field :DR, Type: Dictionary
115
+ field :DA, Type: String
116
+ field :Q, Type: Integer
117
+ field :XFA, Type: [XFAStream, Array.of(String, XFAStream)]
118
+ end
119
+
120
+ module Field
121
+ #
122
+ # Types of fields.
123
+ #
124
+ module Type
125
+ BUTTON = :Btn
126
+ TEXT = :Tx
127
+ CHOICE = :Ch
128
+ SIGNATURE = :Sig
129
+ end
145
130
 
146
- class AdditionalActions < Dictionary
147
- include StandardObject
131
+ #
132
+ # Flags relative to fields.
133
+ #
134
+ module Flags
135
+ READONLY = 1 << 0
136
+ REQUIRED = 1 << 1
137
+ NOEXPORT = 1 << 2
138
+ end
148
139
 
149
- field :K, :Type => Dictionary, :Version => "1.3"
150
- field :F, :Type => Dictionary, :Version => "1.3"
151
- field :V, :Type => Dictionary, :Version => "1.3"
152
- field :C, :Type => Dictionary, :Version => "1.3"
153
- end
140
+ module TextAlign
141
+ LEFT = 0
142
+ CENTER = 1
143
+ RIGHT = 2
144
+ end
154
145
 
155
- def self.included(receiver) #:nodoc:
156
- receiver.field :FT, :Type => Name, :Required => true
157
- receiver.field :Parent, :Type => Field
158
- receiver.field :Kids, :Type => Array.of(Field)
159
- receiver.field :T, :Type => String
160
- receiver.field :TU, :Type => String, :Version => "1.3"
161
- receiver.field :TM, :Type => String, :Version => "1.3"
162
- receiver.field :Ff, :Type => Integer, :Default => 0
163
- receiver.field :V, :Type => Object
164
- receiver.field :DV, :Type => Object
165
- receiver.field :AA, :Type => AdditionalActions, :Version => "1.2"
166
-
167
- # Variable text fields
168
- receiver.field :DA, :Type => String, :Default => "/F1 10 Tf 0 g", :Required => true
169
- receiver.field :Q, :Type => Integer, :Default => TextAlign::LEFT
170
- receiver.field :DS, :Type => String, :Version => "1.5"
171
- receiver.field :RV, :Type => [ String, Stream ], :Version => "1.5"
172
- end
146
+ class AdditionalActions < Dictionary
147
+ include StandardObject
173
148
 
174
- def pre_build #:nodoc:
175
- unless self.key?(:T)
176
- self.set_name "field#{self.object_id}"
177
- end
149
+ field :K, Type: Dictionary, Version: "1.3"
150
+ field :F, Type: Dictionary, Version: "1.3"
151
+ field :V, Type: Dictionary, Version: "1.3"
152
+ field :C, Type: Dictionary, Version: "1.3"
153
+ end
178
154
 
179
- super
180
- end
155
+ def self.included(receiver) # :nodoc:
156
+ receiver.field :FT, Type: Name, Required: true
157
+ receiver.field :Parent, Type: Field
158
+ receiver.field :Kids, Type: Array.of(Field)
159
+ receiver.field :T, Type: String
160
+ receiver.field :TU, Type: String, Version: "1.3"
161
+ receiver.field :TM, Type: String, Version: "1.3"
162
+ receiver.field :Ff, Type: Integer, Default: 0
163
+ receiver.field :V, Type: Object
164
+ receiver.field :DV, Type: Object
165
+ receiver.field :AA, Type: AdditionalActions, Version: "1.2"
166
+
167
+ # Variable text fields
168
+ receiver.field :DA, Type: String, Default: "/F1 10 Tf 0 g", Required: true
169
+ receiver.field :Q, Type: Integer, Default: TextAlign::LEFT
170
+ receiver.field :DS, Type: String, Version: "1.5"
171
+ receiver.field :RV, Type: [String, Stream], Version: "1.5"
172
+ end
181
173
 
182
- #
183
- # Sets the (partial) name of the field.
184
- #
185
- def set_name(field_name)
186
- self.T = field_name
187
- self
188
- end
174
+ def pre_build # :nodoc:
175
+ unless key?(:T)
176
+ set_name "field#{object_id}"
177
+ end
189
178
 
190
- #
191
- # Sets the (partial) name of the field.
192
- #
193
- def name=(field_name)
194
- self.T = field_name
195
- end
179
+ super
180
+ end
196
181
 
197
- #
198
- # Returns the (partial) name of the field.
199
- #
200
- def name
201
- self.T
202
- end
182
+ #
183
+ # Sets the (partial) name of the field.
184
+ #
185
+ def set_name(field_name)
186
+ self.T = field_name
187
+ self
188
+ end
189
+
190
+ #
191
+ # Sets the (partial) name of the field.
192
+ #
193
+ def name=(field_name)
194
+ self.T = field_name
195
+ end
203
196
 
204
- def onKeyStroke(action)
205
- unless action.is_a?(Action)
206
- raise TypeError, "An Action object must be passed."
207
- end
197
+ #
198
+ # Returns the (partial) name of the field.
199
+ #
200
+ def name
201
+ self.T
202
+ end
208
203
 
209
- self.AA ||= AdditionalActions.new
210
- self.AA.K = action
211
- end
204
+ def onKeyStroke(action)
205
+ unless action.is_a?(Action)
206
+ raise TypeError, "An Action object must be passed."
207
+ end
212
208
 
213
- def onFormat(action)
214
- unless action.is_a?(Action)
215
- raise TypeError, "An Action object must be passed."
216
- end
209
+ self.AA ||= AdditionalActions.new
210
+ self.AA.K = action
211
+ end
217
212
 
218
- self.AA ||= AdditionalActions.new
219
- self.AA.F = action
220
- end
213
+ def onFormat(action)
214
+ unless action.is_a?(Action)
215
+ raise TypeError, "An Action object must be passed."
216
+ end
221
217
 
222
- def onValidate(action)
223
- unless action.is_a?(Action)
224
- raise TypeError, "An Action object must be passed."
225
- end
218
+ self.AA ||= AdditionalActions.new
219
+ self.AA.F = action
220
+ end
226
221
 
227
- self.AA ||= AdditionalActions.new
228
- self.AA.V = action
229
- end
222
+ def onValidate(action)
223
+ unless action.is_a?(Action)
224
+ raise TypeError, "An Action object must be passed."
225
+ end
230
226
 
231
- def onCalculate(action)
232
- unless action.is_a?(Action)
233
- raise TypeError, "An Action object must be passed."
234
- end
227
+ self.AA ||= AdditionalActions.new
228
+ self.AA.V = action
229
+ end
235
230
 
236
- self.AA ||= AdditionalActions.new
237
- self.AA.C = action
238
- end
231
+ def onCalculate(action)
232
+ unless action.is_a?(Action)
233
+ raise TypeError, "An Action object must be passed."
234
+ end
239
235
 
240
- class Subform < Dictionary
241
- include StandardObject
242
- include Field
236
+ self.AA ||= AdditionalActions.new
237
+ self.AA.C = action
238
+ end
243
239
 
244
- def add_fields(*fields)
245
- self.Kids ||= []
246
- self.Kids.concat(fields)
240
+ class Subform < Dictionary
241
+ include StandardObject
242
+ include Field
247
243
 
248
- fields.each { |field| field.Parent = self }
244
+ def add_fields(*fields)
245
+ self.Kids ||= []
246
+ self.Kids.concat(fields)
249
247
 
250
- self
251
- end
252
- end
248
+ fields.each { |field| field.Parent = self }
253
249
 
254
- class SignatureLock < Dictionary
255
- include StandardObject
250
+ self
251
+ end
252
+ end
256
253
 
257
- module Actions
258
- ALL = :All
259
- INCLUDE = :Include
260
- EXCLUDE = :Exclude
261
- end
254
+ class SignatureLock < Dictionary
255
+ include StandardObject
262
256
 
263
- field :Type, :Type => Name, :Default => :SigFieldLock
264
- field :Action, :Type => Name, :Required => true
265
- field :Fields, :Type => Array
257
+ module Actions
258
+ ALL = :All
259
+ INCLUDE = :Include
260
+ EXCLUDE = :Exclude
261
+ end
266
262
 
267
- def pre_build
268
- if self.Action and self.Action != Actions::ALL
269
- self.Fields ||= []
270
- end
263
+ field :Type, Type: Name, Default: :SigFieldLock
264
+ field :Action, Type: Name, Required: true
265
+ field :Fields, Type: Array
271
266
 
272
- super
273
- end
267
+ def pre_build
268
+ if self.Action && (self.Action != Actions::ALL)
269
+ self.Fields ||= []
274
270
  end
275
271
 
276
- class SignatureSeedValue < Dictionary
277
- include StandardObject
278
-
279
- module Digest
280
- SHA1 = :SHA1
281
- SHA256 = :SHA256
282
- SHA384 = :SHA384
283
- SHA512 = :SHA512
284
- RIPEMD160 = :RIPEMD160
285
- end
286
-
287
- field :Type, :Type => Name, :Default => :SV
288
- field :Filter, :Type => Name
289
- field :SubFilter, :Type => Array
290
- field :DigestMethod, :Type => Array, :Default => Digest::SHA1, :Version => "1.7"
291
- field :V, :Type => Real, :Default => 1.0
292
- field :Cert, :Type => Dictionary
293
- field :Reasons, :Type => Array
294
- field :MDP, :Type => Dictionary, :Version => "1.6"
295
- field :TimeStamp, :Type => Dictionary, :Version => "1.6"
296
- field :LegalAttestation, :Type => Array, :Version => "1.6"
297
- field :AddRevInfo, :Type => Boolean, :Default => false, :Version => "1.7"
298
- field :Ff, :Type => Integer, :Default => 0
299
- end
272
+ super
273
+ end
274
+ end
300
275
 
301
- class CertificateSeedValue < Dictionary
302
- include StandardObject
303
-
304
- module URL
305
- BROWSER = :Browser
306
- ASSP = :ASSP
307
- end
308
-
309
- field :Type, :Type => Name, :Default => :SVCert
310
- field :Subject, :Type => Array
311
- field :SubjectDN, :Type => Array, :Version => "1.7"
312
- field :KeyUsage, :Type => Array, :Version => "1.7"
313
- field :Issuer, :Type => Array
314
- field :OID, :Type => Array
315
- field :URL, :Type => String
316
- field :URLType, :Type => Name, :Default => URL::BROWSER, :Version => "1.7"
317
- field :Ff, :Type => Integer, :Default => 0
318
- end
276
+ class SignatureSeedValue < Dictionary
277
+ include StandardObject
278
+
279
+ module Digest
280
+ SHA1 = :SHA1
281
+ SHA256 = :SHA256
282
+ SHA384 = :SHA384
283
+ SHA512 = :SHA512
284
+ RIPEMD160 = :RIPEMD160
285
+ end
286
+
287
+ field :Type, Type: Name, Default: :SV
288
+ field :Filter, Type: Name
289
+ field :SubFilter, Type: Array
290
+ field :DigestMethod, Type: Array, Default: Digest::SHA1, Version: "1.7"
291
+ field :V, Type: Real, Default: 1.0
292
+ field :Cert, Type: Dictionary
293
+ field :Reasons, Type: Array
294
+ field :MDP, Type: Dictionary, Version: "1.6"
295
+ field :TimeStamp, Type: Dictionary, Version: "1.6"
296
+ field :LegalAttestation, Type: Array, Version: "1.6"
297
+ field :AddRevInfo, Type: Boolean, Default: false, Version: "1.7"
298
+ field :Ff, Type: Integer, Default: 0
319
299
  end
320
300
 
301
+ class CertificateSeedValue < Dictionary
302
+ include StandardObject
303
+
304
+ module URL
305
+ BROWSER = :Browser
306
+ ASSP = :ASSP
307
+ end
308
+
309
+ field :Type, Type: Name, Default: :SVCert
310
+ field :Subject, Type: Array
311
+ field :SubjectDN, Type: Array, Version: "1.7"
312
+ field :KeyUsage, Type: Array, Version: "1.7"
313
+ field :Issuer, Type: Array
314
+ field :OID, Type: Array
315
+ field :URL, Type: String
316
+ field :URLType, Type: Name, Default: URL::BROWSER, Version: "1.7"
317
+ field :Ff, Type: Integer, Default: 0
318
+ end
319
+ end
321
320
  end