gpt4 book ai didi

org.bouncycastle.asn1.x509.X509CertificateStructure类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 06:42:40 28 4
gpt4 key购买 nike

本文整理了Java中org.bouncycastle.asn1.x509.X509CertificateStructure类的一些代码示例,展示了X509CertificateStructure类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X509CertificateStructure类的具体详情如下:
包路径:org.bouncycastle.asn1.x509.X509CertificateStructure
类名称:X509CertificateStructure

X509CertificateStructure介绍

[英]an X509Certificate structure.

Certificate ::= SEQUENCE { 
tbsCertificate          TBSCertificate, 
signatureAlgorithm      AlgorithmIdentifier, 
signature               BIT STRING 
}

[中]X509证书结构

Certificate ::= SEQUENCE { 
tbsCertificate          TBSCertificate, 
signatureAlgorithm      AlgorithmIdentifier, 
signature               BIT STRING 
}

代码示例

代码示例来源:origin: com.google.code.jscep/jscep-api

private X509CertificateStructure getCertificate() {
  try {
    ASN1Sequence seq = (ASN1Sequence) ASN1Object.fromByteArray(identity.getEncoded());
    X509CertificateStructure x509 = new X509CertificateStructure(seq);
    
    return x509;
  } catch (CertificateEncodingException e) {
    throw new RuntimeException(e);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: redfish64/TinyTravelTracker

public static X509CertificateStructure getInstance(
  ASN1TaggedObject obj,
  boolean          explicit)
{
  return getInstance(ASN1Sequence.getInstance(obj, explicit));
}

代码示例来源:origin: coova/jradius

/**
 * Encodes version of the ClientCertificate message
 * 
 * @param os stream to write the message to
 * @throws IOException If something goes wrong
 */
protected void encode(OutputStream os) throws IOException
{
  Vector encCerts = new Vector();
  int totalSize = 0;
  for (int i = 0; i < this.certs.length; ++i)
  {
    byte[] encCert = certs[i].getEncoded();
    encCerts.addElement(encCert);
    totalSize += encCert.length + 3;
  }
  TlsUtils.writeUint24(totalSize + 3, os);
  TlsUtils.writeUint24(totalSize, os);
  for (int i = 0; i < encCerts.size(); ++i)
  {
    byte[] encCert = (byte[])encCerts.elementAt(i);
    TlsUtils.writeOpaque24(encCert, os);
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

/**
 * @deprecated use constructor taking Certificate
 */
public IssuerAndSerialNumber(
  X509CertificateStructure certificate)
{
  this.name = certificate.getIssuer();
  this.serialNumber = certificate.getSerialNumber();
}

代码示例来源:origin: open-eid/digidoc4j

ASN1InputStream aIn = new ASN1InputStream(bIn);
ASN1Sequence seq = (ASN1Sequence)aIn.readObject();
X509CertificateStructure obj = new X509CertificateStructure(seq);
TBSCertificateStructure tbsCert = obj.getTBSCertificate();
if (tbsCert.getVersion() == 3) {
  X509Extensions ext = tbsCert.getExtensions();

代码示例来源:origin: net.jradius/jradius-extended

private void validateKeyUsage(X509CertificateStructure c, int keyUsageBits) throws IOException
{
  X509Extensions exts = c.getTBSCertificate().getExtensions();
  if (exts != null)
  {
    X509Extension ext = exts.getExtension(X509Extensions.KeyUsage);
    if (ext != null)
    {
      DERBitString ku = KeyUsage.getInstance(ext);
      int bits = ku.getBytes()[0] & 0xff;
      if ((bits & keyUsageBits) != keyUsageBits)
      {
        handler.failWithError(TlsProtocolHandler.AL_fatal,
          TlsProtocolHandler.AP_certificate_unknown);
      }
    }
  }
}

代码示例来源:origin: com.hynnet/jradius-extended

public void processServerCertificate(Certificate serverCertificate) throws IOException
  SubjectPublicKeyInfo keyInfo = x509Cert.getSubjectPublicKeyInfo();

代码示例来源:origin: redfish64/TinyTravelTracker

/**
 * @deprecated use constructor taking Certificate
 */
public IssuerAndSerialNumber(
  X509CertificateStructure certificate)
{
  this.name = certificate.getIssuer();
  this.serialNumber = certificate.getSerialNumber();
}

代码示例来源:origin: com.hynnet/jradius-extended

private void validateKeyUsage(X509CertificateStructure c, int keyUsageBits) throws IOException
{
  X509Extensions exts = c.getTBSCertificate().getExtensions();
  if (exts != null)
  {
    X509Extension ext = exts.getExtension(X509Extensions.KeyUsage);
    if (ext != null)
    {
      DERBitString ku = KeyUsage.getInstance(ext);
      int bits = ku.getBytes()[0] & 0xff;
      if ((bits & keyUsageBits) != keyUsageBits)
      {
        handler.failWithError(TlsProtocolHandler.AL_fatal,
          TlsProtocolHandler.AP_certificate_unknown);
      }
    }
  }
}

代码示例来源:origin: net.jradius/jradius-extended

public void processServerCertificate(Certificate serverCertificate) throws IOException
  SubjectPublicKeyInfo keyInfo = x509Cert.getSubjectPublicKeyInfo();

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public static X509CertificateStructure getInstance(
  ASN1TaggedObject obj,
  boolean          explicit)
{
  return getInstance(ASN1Sequence.getInstance(obj, explicit));
}

代码示例来源:origin: com.hynnet/jradius-extended

private void validateKeyUsage(X509CertificateStructure c, int keyUsageBits) throws IOException
{
  X509Extensions exts = c.getTBSCertificate().getExtensions();
  if (exts != null)
  {
    X509Extension ext = exts.getExtension(X509Extensions.KeyUsage);
    if (ext != null)
    {
      DERBitString ku = KeyUsage.getInstance(ext);
      int bits = ku.getBytes()[0] & 0xff;
      if ((bits & keyUsageBits) != keyUsageBits)
      {
        handler.failWithError(TlsProtocolHandler.AL_fatal,
          TlsProtocolHandler.AP_certificate_unknown);
      }
    }
  }
}

代码示例来源:origin: coova/jradius

public void processServerCertificate(Certificate serverCertificate) throws IOException
  SubjectPublicKeyInfo keyInfo = x509Cert.getSubjectPublicKeyInfo();

代码示例来源:origin: redfish64/TinyTravelTracker

public static X509CertificateStructure getInstance(
  Object  obj)
{
  if (obj instanceof X509CertificateStructure)
  {
    return (X509CertificateStructure)obj;
  }
  else if (obj != null)
  {
    return new X509CertificateStructure(ASN1Sequence.getInstance(obj));
  }
  return null;
}

代码示例来源:origin: com.hynnet/jradius-extended

/**
 * Encodes version of the ClientCertificate message
 * 
 * @param os stream to write the message to
 * @throws IOException If something goes wrong
 */
protected void encode(OutputStream os) throws IOException
{
  Vector encCerts = new Vector();
  int totalSize = 0;
  for (int i = 0; i < this.certs.length; ++i)
  {
    byte[] encCert = certs[i].getEncoded(ASN1Encodable.DER);
    encCerts.addElement(encCert);
    totalSize += encCert.length + 3;
  }
  TlsUtils.writeUint24(totalSize + 3, os);
  TlsUtils.writeUint24(totalSize, os);
  for (int i = 0; i < encCerts.size(); ++i)
  {
    byte[] encCert = (byte[])encCerts.elementAt(i);
    TlsUtils.writeOpaque24(encCert, os);
  }
}

代码示例来源:origin: net.jradius/jradius-extended

ASN1InputStream ais = new ASN1InputStream(bis);
DERObject o = ais.readObject();
tmp.addElement(X509CertificateStructure.getInstance(o));
if (bis.available() > 0)

代码示例来源:origin: coova/jradius

private void validateKeyUsage(X509CertificateStructure c, int keyUsageBits) throws IOException
{
  X509Extensions exts = c.getTBSCertificate().getExtensions();
  if (exts != null)
  {
    X509Extension ext = exts.getExtension(X509Extensions.KeyUsage);
    if (ext != null)
    {
      KeyUsage ku = KeyUsage.getInstance(ext);
      int bits = ku.getBytes()[0] & 0xff;
      if ((bits & keyUsageBits) != keyUsageBits)
      {
        handler.failWithError(TlsProtocolHandler.AL_fatal,
          TlsProtocolHandler.AP_certificate_unknown);
      }
    }
  }
}

代码示例来源:origin: com.hynnet/jradius-extended

SubjectPublicKeyInfo keyInfo = x509Cert.getSubjectPublicKeyInfo();

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public static X509CertificateStructure getInstance(
  Object  obj)
{
  if (obj instanceof X509CertificateStructure)
  {
    return (X509CertificateStructure)obj;
  }
  else if (obj != null)
  {
    return new X509CertificateStructure(ASN1Sequence.getInstance(obj));
  }
  return null;
}

代码示例来源:origin: net.jradius/jradius-extended

/**
 * Encodes version of the ClientCertificate message
 * 
 * @param os stream to write the message to
 * @throws IOException If something goes wrong
 */
protected void encode(OutputStream os) throws IOException
{
  Vector encCerts = new Vector();
  int totalSize = 0;
  for (int i = 0; i < this.certs.length; ++i)
  {
    byte[] encCert = certs[i].getEncoded(ASN1Encodable.DER);
    encCerts.addElement(encCert);
    totalSize += encCert.length + 3;
  }
  TlsUtils.writeUint24(totalSize + 3, os);
  TlsUtils.writeUint24(totalSize, os);
  for (int i = 0; i < encCerts.size(); ++i)
  {
    byte[] encCert = (byte[])encCerts.elementAt(i);
    TlsUtils.writeOpaque24(encCert, os);
  }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com