Class OpenSshCertificate.CertificateOption

  • Enclosing interface:
    OpenSshCertificate

    public static class OpenSshCertificate.CertificateOption
    extends java.lang.Object
    Certificate Options are a set of bytes that is
     [overall length][name(string)][[length of buffer][[length of string][data(string)]]]...
     

    Where each Certificate Option is encoded as a name (string) and data (string packed in a buffer). The entire name (string) + data (buffer) are added as bytes (which will get a length prefix).

    See Also:
    PROTOCOL.certkeys
    • Field Detail

      • name

        private final java.lang.String name
      • data

        private final java.lang.String data
    • Constructor Detail

      • CertificateOption

        public CertificateOption​(java.lang.String name,
                                 java.lang.String data)
        Creates a new OpenSshCertificate.CertificateOption with the given name and data.
        Parameters:
        name - of the option; must be neither null nor empty
        data - for the option; may be null or empty
      • CertificateOption

        public CertificateOption​(java.lang.String name)
        Creates a new OpenSshCertificate.CertificateOption with a name without data.
        Parameters:
        name - of the option; must be neither null nor empty
    • Method Detail

      • getName

        public final java.lang.String getName()
        Retrieves the name.
        Returns:
        the name, never null
      • getData

        public final java.lang.String getData()
        Retrieves the data.
        Returns:
        the data, may benull or empty
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object