Class DANEEntry

java.lang.Object
org.bouncycastle.cert.dane.DANEEntry

public class DANEEntry extends Object
Carrier class for a DANE entry.
  • Field Details

  • Constructor Details

    • DANEEntry

      public DANEEntry(String domainName, byte[] data) throws IOException
      Create an entry from the RDATA of a DNS record.
      Parameters:
      domainName - the owner name of the record.
      data - the record's RDATA: the three flag bytes followed by the certificate encoding.
      Throws:
      IOException - if the flags do not describe a full certificate entry (see isValidCertificate(byte[])) or the certificate encoding is malformed.
  • Method Details

    • getFlags

      public byte[] getFlags()
      Return the three flag bytes: certificate usage, selector and matching type.
      Returns:
      a copy of the flag bytes.
    • getCertificate

      public X509CertificateHolder getCertificate()
      Return the certificate associated with this entry.
      Returns:
      the entry's certificate.
    • getDomainName

      public String getDomainName()
      Return the owner name of the DNS record this entry came from or is destined for.
      Returns:
      the entry's fully qualified domain name.
    • getRDATA

      public byte[] getRDATA() throws IOException
      Return the full data string as it would appear in the DNS record - flags + encoding
      Returns:
      byte array representing the full data string.
      Throws:
      IOException - if there is an issue encoding the certificate inside this entry.
    • isValidCertificate

      public static boolean isValidCertificate(byte[] data)
      Return true if the byte string has the correct flag bytes to indicate a certificate entry.
      Parameters:
      data - the byte string of interest.
      Returns:
      true if flags indicate a valid certificate, false otherwise.