Get the revocation reason of this certificate.
334266
def get_revocation_reason(self):
        """"""
        if self.revoked is False:
            return

        if self.revoked_reason == '' or self.revoked_reason is None:
            return x509.ReasonFlags.unspecified
        else:
            return getattr(x509.ReasonFlags, self.revoked_reason)
523127
def getValidCertifications(self):
        
        certs = []
        today = date.today()
        for c in self.getCertifications():
            validfrom = c.getValidFrom() if c else None
            validto = c.getValidTo() if validfrom else None
            if not validfrom or not validto:
                continue
            validfrom = validfrom.asdatetime().date()
            validto = validto.asdatetime().date()
            if (today >= validfrom and today <= validto):
                certs.append(c)
        return certs
744684
def revocation_date(self, value):
        

        if value is not None and not isinstance(value, datetime):
            raise TypeError(_pretty_message(
                '''
                revocation_date must be an instance of datetime.datetime, not %s
                ''',
                _type_name(value)
            ))

        self._revocation_date = value
718656
private static String getCertIdIdByStore(KeyStore keyStore) {
		Enumeration<String> aliasenum = null;
		try {
			aliasenum = keyStore.aliases();
			String keyAlias = null;
			if (aliasenum.hasMoreElements()) {
				keyAlias = aliasenum.nextElement();
			}
			X509Certificate cert = (X509Certificate) keyStore
					.getCertificate(keyAlias);
			return cert.getSerialNumber().toString();
		} catch (KeyStoreException e) {
			LogUtil.writeErrorLog("getCertIdIdByStore Error", e);
			return null;
		}
	}
1359798
def raw(self) -> str:
        
        if not isinstance(self.identity, Identity):
            raise MalformedDocumentError("Can not return full revocation document created from inline")

        return """Version: {version}
Type: Revocation
Currency: {currency}
Issuer: {pubkey}
IdtyUniqueID: {uid}
IdtyTimestamp: {timestamp}
IdtySignature: {signature}
""".format(version=self.version,
           currency=self.currency,
           pubkey=self.identity.pubkey,
           uid=self.identity.uid,
           timestamp=self.identity.timestamp,
           signature=self.identity.signatures[0])
353022
def _get_certificate(cert_url):
    """"""
    global _cache

    if cert_url in _cache:
        cert = _cache[cert_url]
        if cert.has_expired():
            _cache = {}
        else:
            return cert

    url = urlparse(cert_url)
    host = url.netloc.lower()
    path = posixpath.normpath(url.path)

    # Sanity check location so we don't get some random person's cert.
    if url.scheme != 'https' or \
       host not in ['s3.amazonaws.com', 's3.amazonaws.com:443'] or \
       not path.startswith('/echo.api/'):
        log.error('invalid cert location %s', cert_url)
        return

    resp = urlopen(cert_url)
    if resp.getcode() != 200:
        log.error('failed to download certificate')
        return

    cert = crypto.load_certificate(crypto.FILETYPE_PEM, resp.read())

    if cert.has_expired() or cert.get_subject().CN != 'echo-api.amazon.com':
        log.error('certificate expired or invalid')
        return

    _cache[cert_url] = cert
    return cert
728313
function () {
        var obj = PropertyBase.toJSON(this);

        _.unset(obj, 'key.value');
        _.unset(obj, 'cert.value');
        _.unset(obj, 'pfx.value');

        return obj;
    }
1050033
public X509CertChainValidatorExt build() {

    RevocationParametersExt revocationParameters = new RevocationParametersExt(
      crlChecks, new CRLParameters(), new OCSPParametes(ocspChecks));

    ValidatorParamsExt validationParams = new ValidatorParamsExt(
      revocationParameters, ProxySupport.ALLOW);

    if (storeUpdateListener != null){
      validationParams.setInitialListeners(Arrays.asList(storeUpdateListener));
    }
    
    boolean openssl1xMode = false;
    
    if (opensslHashFunction == OpensslHashFunction.SHA1){
      openssl1xMode = true;
    }
    
    OpensslCertChainValidator validator = new OpensslCertChainValidator(
      trustAnchorsDir, openssl1xMode, namespaceChecks, trustAnchorsUpdateInterval,
      validationParams, lazyAnchorsLoading);

    if (validationErrorListener != null){
      validator.addValidationListener(validationErrorListener);
    }
    
    return validator;
  }
1171538
public static PublicKey getValidatePublicKey(String certId) {
		X509Certificate cf = null;
		if (certMap.containsKey(certId)) {
			// 存在certId对应的证书对象
			cf = certMap.get(certId);
			return cf.getPublicKey();
		} else {
			// 不存在则重新Load证书文件目录
			initValidateCertFromDir();
			if (certMap.containsKey(certId)) {
				// 存在certId对应的证书对象
				cf = certMap.get(certId);
				return cf.getPublicKey();
			} else {
				LogUtil.writeErrorLog("缺少certId=[" + certId + "]对应的验签证书.");
				return null;
			}
		}
	}
1369300
public String getIssueKey() {
        Issue issue = getAnnotation(Issue.class);
        return issue == null ? null : issue.value();
    }
572625
function getRevokedCertificateExtensions($serial, $crl = null)
    {
        if (!isset($crl)) {
            $crl = $this->currentCert;
        }

        if (is_array($rclist = $this->_subArray($crl, 'tbsCertList/revokedCertificates'))) {
            if (($i = $this->_revokedCertificate($rclist, $serial)) !== false) {
                return $this->_getExtensions($crl, "tbsCertList/revokedCertificates/$i/crlEntryExtensions");
            }
        }

        return false;
    }
54987
def _identify(self, subject):
        
        ourPrivateCert = self.service.certificateStorage.getPrivateCertificate(
            str(subject)
        )
        ourCA = Certificate(ourPrivateCert.original)
        return dict(certificate=ourCA)
472470
@JsonIgnore
    public String getEncryptionCertificateDecoded() {
        if (EncodingUtils.isBase64(encryptionCertificate)) {
            return EncodingUtils.decodeBase64ToString(encryptionCertificate);
        }
        return encryptionCertificate;
    }
759373
def load(self):
        """"""

        private = self.is_private()
        with open_tls_file(self.file_path, 'r', private=private) as fh:
            if private:
                self.x509 = crypto.load_privatekey(self.encoding, fh.read())
            else:
                self.x509 = crypto.load_certificate(self.encoding, fh.read())
            return self.x509
863417
def revoke_expired_certs!
      FastlaneCore::PrintTable.print_values(config: Cert.config, hide_keys: [:output_path], title: "Summary for cert #{Fastlane::VERSION}")

      login

      to_revoke = expired_certs

      if to_revoke.empty?
        UI.success("No expired certificates were found to revoke! 👍")
        return
      end

      revoke_count = 0

      to_revoke.each do |certificate|
        begin
          UI.message("#{certificate.id} #{certificate.name} has expired, revoking...")
          certificate.revoke!
          revoke_count += 1
        rescue => e
          UI.error("An error occurred while revoking #{certificate.id} #{certificate.name}")
          UI.error("#{e.message}\n#{e.backtrace.join("\n")}") if FastlaneCore::Globals.verbose?
        end
      end

      UI.success("#{revoke_count} expired certificate#{'s' if revoke_count != 1} #{revoke_count == 1 ? 'has' : 'have'} been revoked! 👍")
    end
849693
public CertificateBundle getCertificate(String certificateIdentifier) {
        CertificateIdentifier id = new CertificateIdentifier(certificateIdentifier);
        return getCertificate(id.vault(), id.name(), id.version() == null ? "" : id.version());
    }
1320645
function getRevokedCertificateExtension($serial, $id, $crl = NULL)
    {
        if (!isset($crl)) {
            $crl = $this->currentCert;
        }

        if (is_array($rclist = $this->_subArray($crl, 'tbsCertList/revokedCertificates'))) {
            if (($i = $this->_revokedCertificate($rclist, $serial)) !== false) {
                return $this->_getExtension($id, $crl,  "tbsCertList/revokedCertificates/$i/crlEntryExtensions");
            }
        }

        return false;
    }