Class: Pdfrb::Model::Type::Vri

Inherits:
Cos::Dictionary show all
Defined in:
lib/pdfrb/model/type/vri.rb

Overview

VRI (Validation Related Information) dictionary per ETSI EN 319 142-1 (PAdES) §B.5. Lives in /DSS /VRI map, keyed by the hex-encoded SHA-1 of the signature it validates. Holds the certificates, CRLs, and OCSP responses relevant to one signature.

Instance Attribute Summary

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

Methods inherited from Cos::Dictionary

#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate

Methods inherited from Object

#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type

Constructor Details

This class inherits a constructor from Pdfrb::Model::Cos::Dictionary

Instance Method Details

#certificates(document = nil) ⇒ Object

/Cert — array of indirect streams, each a DER-encoded X.509 certificate relevant to the signature.



21
22
23
24
25
26
# File 'lib/pdfrb/model/type/vri.rb', line 21

def certificates(document = nil)
  refs = value[:Cert]
  return [] unless refs

  resolve_refs(refs, document)
end

#crls(document = nil) ⇒ Object

/CRL — array of indirect streams, each a DER-encoded certificate revocation list.



30
31
32
33
34
35
# File 'lib/pdfrb/model/type/vri.rb', line 30

def crls(document = nil)
  refs = value[:CRL]
  return [] unless refs

  resolve_refs(refs, document)
end

#ocsp_responses(document = nil) ⇒ Object

/OCSP — array of indirect streams, each a DER-encoded OCSP response.



39
40
41
42
43
44
# File 'lib/pdfrb/model/type/vri.rb', line 39

def ocsp_responses(document = nil)
  refs = value[:OCSP]
  return [] unless refs

  resolve_refs(refs, document)
end

#timestamp_textObject

/TU — optional string-text with a human-readable timestamp.



47
48
49
# File 'lib/pdfrb/model/type/vri.rb', line 47

def timestamp_text
  value[:TU]
end

#timestamp_token(document = nil) ⇒ Object

/TS — optional indirect stream with a timestamp token.



52
53
54
55
56
57
# File 'lib/pdfrb/model/type/vri.rb', line 52

def timestamp_token(document = nil)
  ref = value[:TS]
  return nil unless ref && document

  ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
end

#typeObject

/Type — optional, fixed "VRI".



15
16
17
# File 'lib/pdfrb/model/type/vri.rb', line 15

def type
  value[:Type]&.to_sym
end