Module: Shojiku::Material

Defined in:
lib/shojiku/errors.rb

Overview

Reading the byte inputs signing and verification take.

One place, because both paths owe the same thing: binary mode (PEM is bytes, and a transcode would corrupt a DER-bearing file), and an unreadable file surfacing as MaterialUnreadable rather than as a raw Errno nobody upstream is catching.

Class Method Summary collapse

Class Method Details

.read(path, kind) ⇒ Object



90
91
92
93
94
# File 'lib/shojiku/errors.rb', line 90

def self.read(path, kind)
  File.binread(path)
rescue SystemCallError => e
  raise MaterialUnreadable.new(kind, e.message)
end