Class: Pliney::AppleCodeSignature::Blob

Inherits:
Object
  • Object
show all
Defined in:
lib/pliney/apple_code_signature.rb

Direct Known Subclasses

CodeDirectory, OpaqueBlob, Requirement, SuperBlob

Defined Under Namespace

Classes: Magic

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(magic, data) {|_self| ... } ⇒ Blob

Returns a new instance of Blob.

Yields:

  • (_self)

Yield Parameters:



19
20
21
22
23
24
# File 'lib/pliney/apple_code_signature.rb', line 19

def initialize(magic, data)
    @magic = Magic.new(magic)
    @input = data.is_a?(StringStream)? data : StringStream.new(data)
    @base = @input.pos-4
    yield self if block_given?
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



17
18
19
# File 'lib/pliney/apple_code_signature.rb', line 17

def input
  @input
end

#magicObject (readonly)

Returns the value of attribute magic.



17
18
19
# File 'lib/pliney/apple_code_signature.rb', line 17

def magic
  @magic
end

#sizeObject (readonly)

Returns the value of attribute size.



17
18
19
# File 'lib/pliney/apple_code_signature.rb', line 17

def size
  @size
end

Instance Method Details

#parseObject



26
27
28
29
30
31
32
33
# File 'lib/pliney/apple_code_signature.rb', line 26

def parse
    if @input
        @size = input.read_uint32
        yield 
    end
    @input=nil
    return self
end