Class TrustStore

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.installer.plugin.impl.TrustStore
All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent

@Deprecated(forRemoval=true, since="5.2") @NotThreadSafe public final class TrustStore extends AbstractInitializableComponent
Deprecated, for removal: This API element is subject to removal in a future version.
Code to handle (load, update, check) the trust store for an individual plugin. a thin shim on BC.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Deprecated, for removal: This API element is subject to removal in a future version.
    An opaque handle around a PGPSignature.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Path
    Deprecated, for removal: This API element is subject to removal in a future version.
    The key store backup.
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Explicit path to trust store.
    private Path
    Deprecated, for removal: This API element is subject to removal in a future version.
    Where the IdP is installed.
    private org.bouncycastle.openpgp.PGPPublicKeyRingCollection
    Deprecated, for removal: This API element is subject to removal in a future version.
    KeyRing.
    private final org.slf4j.Logger
    Deprecated, for removal: This API element is subject to removal in a future version.
    logger.
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
    The plugin this is the trust store for.
    private Path
    Deprecated, for removal: This API element is subject to removal in a future version.
    The key store.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Run a signature check over the streams.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Does the key that made this signature exist in our keyrings?
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create an empty store and save to new location.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Load up the provided store and if the key is found and the Predicate allows it add it to the store which we will then save.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Load the store from its designated location.
    private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return a store loaded from the supplied stream.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Save the store to its designated location.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Save the store to its designated location.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set IdPHome.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the pluginId.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set explicitTrustStore.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Provide an opaque signature object from an input stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Deprecated, for removal: This API element is subject to removal in a future version.
      logger.
    • idpHome

      @NonnullAfterInit private Path idpHome
      Deprecated, for removal: This API element is subject to removal in a future version.
      Where the IdP is installed.
    • explicitTrustStore

      @NonnullAfterInit private String explicitTrustStore
      Deprecated, for removal: This API element is subject to removal in a future version.
      Explicit path to trust store.
    • pluginId

      @Nullable private String pluginId
      Deprecated, for removal: This API element is subject to removal in a future version.
      The plugin this is the trust store for. NULL of this is general purpose usage.
    • store

      @NonnullAfterInit private Path store
      Deprecated, for removal: This API element is subject to removal in a future version.
      The key store.
    • backup

      @NonnullAfterInit private Path backup
      Deprecated, for removal: This API element is subject to removal in a future version.
      The key store backup.
    • keyRings

      @NonnullAfterInit private org.bouncycastle.openpgp.PGPPublicKeyRingCollection keyRings
      Deprecated, for removal: This API element is subject to removal in a future version.
      KeyRing.
  • Constructor Details

    • TrustStore

      public TrustStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • setPluginId

      public void setPluginId(String what)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the pluginId.
      Parameters:
      what - to set.
    • setIdpHome

      public void setIdpHome(@Nonnull Path what)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set IdPHome.
      Parameters:
      what - The idpHome to set.
    • setTrustStore

      public void setTrustStore(@Nullable String what)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set explicitTrustStore.
      Parameters:
      what - The value to set.
    • loadStoreFrom

      private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection loadStoreFrom(@Nonnull InputStream in) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return a store loaded from the supplied stream.
      Parameters:
      in - the stream
      Returns:
      a suitable store
      Throws:
      IOException - from Files.newInputStream(Path, java.nio.file.OpenOption...) and from PGPPublicKeyRingCollection(InputStream, org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator)
    • loadStore

      protected void loadStore() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Load the store from its designated location.
      Throws:
      IOException - from Files.newInputStream(Path, java.nio.file.OpenOption...) and from PGPPublicKeyRingCollection(InputStream, org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator)
    • createNewStore

      protected void createNewStore() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create an empty store and save to new location.
      Throws:
      IOException - from saveStore() and in the unlikely event that PGPPublicKeyRingCollection(java.util.Collection) has problems.
    • saveStore

      public void saveStore() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Save the store to its designated location.
      Throws:
      IOException - from Files.newOutputStream(Path, java.nio.file.OpenOption...) and from PGPPublicKeyRingCollection.encode(OutputStream)
    • saveStoreInternal

      public void saveStoreInternal() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Save the store to its designated location.
      Throws:
      IOException - from Files.newOutputStream(Path, java.nio.file.OpenOption...) and from PGPPublicKeyRingCollection.encode(OutputStream)
    • importKeyFromStream

      public void importKeyFromStream(TrustStore.Signature sigForKey, @Nonnull InputStream keyStream, @Nonnull Predicate<String> accept) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Load up the provided store and if the key is found and the Predicate allows it add it to the store which we will then save.
      Parameters:
      sigForKey - the signature we are looking for a key for.
      keyStream - where to load the key from
      accept - whether we actually want to install this key
      Throws:
      IOException - if the load or save fails
    • signatureOf

      @Nonnull public static TrustStore.Signature signatureOf(@Nonnull InputStream stream) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Provide an opaque signature object from an input stream.
      Parameters:
      stream - what to read.
      Returns:
      the Signature.
      Throws:
      IOException - if there is a problem reading the file of it it doesn't represent a signature
    • contains

      public boolean contains(@Nonnull TrustStore.Signature signature)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Does the key that made this signature exist in our keyrings?
      Parameters:
      signature - what to ask about
      Returns:
      whether it is there
    • checkSignature

      public boolean checkSignature(@Nonnull InputStream input, @Nonnull TrustStore.Signature signature) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Run a signature check over the streams.
      Parameters:
      input - what to check
      signature - what to check with
      Returns:
      whether it passed or not
      Throws:
      IOException - if we get an error reading the stream
    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      doInitialize in class AbstractInitializableComponent
      Throws:
      ComponentInitializationException