net.i2p.crypto

## Class DirKeyRing

- java.lang.Object
- - net.i2p.crypto.DirKeyRing

- All Implemented Interfaces:
    KeyRing

      public class DirKeyRing
      extends Object
      implements KeyRing

  Simple storage of each cert in a separate file in a directory. Limited sanitization of filenames.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DirKeyRing(File baseDir)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PublicKey` | `getKey(String keyName, String scope, SigType type)` Cert must be in the file (escaped keyName).crt, and have a CN == keyName.
    `void` | `setKey(String keyName, String scope, PublicKey key)` Unimplemented, unused.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DirKeyRing

          public DirKeyRing(File baseDir)

  - ### Method Detail

    - #### getKey

          public PublicKey getKey(String keyName,
                                  String scope,
                                  SigType type)
                           throws GeneralSecurityException,
                                  IOException

      Cert must be in the file (escaped keyName).crt, and have a CN == keyName. This DOES do a revocation check. CN check unsupported on Android.
      Specified by:
        `getKey` in interface `KeyRing`
        `scope` - a domain identifier, indicating router update, reseed, etc.
      Returns:
        null if file doesn't exist, throws on all other errors
      Throws:
        `GeneralSecurityException`
        `IOException`

    - #### setKey

          public void setKey(String keyName,
                             String scope,
                             PublicKey key)

      Unimplemented, unused.
      Specified by:
        `setKey` in interface `KeyRing`
        `scope` - a domain identifier, indicating router update, reseed, etc.