diff options
Diffstat (limited to 'lib/rubygems/security/trust_dir.rb')
-rw-r--r-- | lib/rubygems/security/trust_dir.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/rubygems/security/trust_dir.rb b/lib/rubygems/security/trust_dir.rb index dd51308ee5..76ef89af7f 100644 --- a/lib/rubygems/security/trust_dir.rb +++ b/lib/rubygems/security/trust_dir.rb @@ -1,10 +1,26 @@ +## +# The TrustDir manages the trusted certificates for gem signature +# verification. + class Gem::Security::TrustDir + ## + # Default permissions for the trust directory and its contents + DEFAULT_PERMISSIONS = { :trust_dir => 0700, :trusted_cert => 0600, } + ## + # The directory where trusted certificates will be stored. + + attr_reader :dir + + ## + # Creates a new TrustDir using +dir+ where the directory and file + # permissions will be checked according to +permissions+ + def initialize dir, permissions = DEFAULT_PERMISSIONS @dir = dir @permissions = permissions @@ -12,8 +28,6 @@ class Gem::Security::TrustDir @digester = Gem::Security::DIGEST_ALGORITHM end - attr_reader :dir - ## # Returns the path to the trusted +certificate+ |