类 PemContent

java.lang.Object
org.springframework.boot.ssl.pem.PemContent

public final class PemContent extends Object
PEM encoded content that can provide certificates and private keys.
从以下版本开始:
3.2.0
作者:
Scott Frederick, Phillip Webb
  • 方法详细资料

    • getCertificates

      public List<X509Certificate> getCertificates()
      Parse and return all certificates from the PEM content. Most PEM files either contain a single certificate or a certificate chain.
      返回:
      the certificates
      抛出:
      IllegalStateException - if no certificates could be loaded
    • getPrivateKey

      public PrivateKey getPrivateKey()
      Parse and return the private keys from the PEM content.
      返回:
      the private keys
      抛出:
      IllegalStateException - if no private key could be loaded
    • getPrivateKey

      public PrivateKey getPrivateKey(String password)
      Parse and return the private keys from the PEM content or null if there is no private key.
      参数:
      password - the password to decrypt the private keys or null
      返回:
      the private keys
    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • load

      public static PemContent load(Path path) throws IOException
      Load PemContent from the given Path.
      参数:
      path - a path to load the content from
      返回:
      the loaded PEM content
      抛出:
      IOException - on IO error
    • load

      public static PemContent load(InputStream in) throws IOException
      Load PemContent from the given InputStream.
      参数:
      in - an input stream to load the content from
      返回:
      the loaded PEM content
      抛出:
      IOException - on IO error
    • of

      public static PemContent of(String text)
      Return a new PemContent instance containing the given text.
      参数:
      text - the text containing PEM encoded content
      返回:
      a new PemContent instance
    • isPresentInText

      public static boolean isPresentInText(String text)
      Return if PEM content is present in the given text.
      参数:
      text - the text to check
      返回:
      if the text includes PEM encoded content.