(self, certificate)
Adds a certificate payload to the profile for server identification.

    Args:
      certificate: str, PEM-formatted certificate.

    Raises:
      CertificateError: there was an error processing the certificate
Adds a certificate payload to the profile for server identification.
Adds a certificate payload to the profile for server identification .
def AddAnchorCertificate(self, certificate):
    """Adds a certificate payload to the profile for server identification.

    Args:
      certificate: str, PEM-formatted certificate.

    Raises:
      CertificateError: there was an error processing the certificate
    """
    try:
      cert = certs.Certificate(certificate)
    except certs.CertError as e:
      raise CertificateError(e)

    payload = {PAYLOADKEYS_IDENTIFIER: self._GenerateID(cert.osx_fingerprint),
               PAYLOADKEYS_TYPE: 'com.apple.security.pkcs1',
               PAYLOADKEYS_DISPLAYNAME: cert.subject_cn,
               PAYLOADKEYS_CONTENT: plistlib.Data(certificate)}

    # Validate payload to generate its UUID
    ValidatePayload(payload)
    self._anchor_certs.append(payload.get(PAYLOADKEYS_UUID))
    self.AddPayload(payload)
def AddAnchorCertificate ( self , certificate ) : try : cert = certs . Certificate ( certificate ) except certs . CertError as e : raise CertificateError ( e ) payload = { PAYLOADKEYS_IDENTIFIER : self . _GenerateID ( cert . osx_fingerprint ) , PAYLOADKEYS_TYPE : 'com.apple.security.pkcs1' , PAYLOADKEYS_DISPLAYNAME : cert . subject_cn , PAYLOADKEYS_CONTENT : plistlib . Data ( certificate ) } # Validate payload to generate its UUID ValidatePayload ( payload ) self . _anchor_certs . append ( payload . get ( PAYLOADKEYS_UUID ) ) self . AddPayload ( payload )