org.spongycastle.asn1.ASN1ObjectIdentifier.equals()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(138)

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

ASN1ObjectIdentifier.equals介绍

暂无

代码示例

代码示例来源:origin: com.madgag/scprov-jdk15on

public static boolean isDsaOid(
  ASN1ObjectIdentifier algOid)
{
  for (int i = 0; i != dsaOids.length; i++)
  {
    if (algOid.equals(dsaOids[i]))
    {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.madgag.spongycastle/prov

public static boolean isDsaOid(
  ASN1ObjectIdentifier algOid)
{
  for (int i = 0; i != dsaOids.length; i++)
  {
    if (algOid.equals(dsaOids[i]))
    {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.madgag/scprov-jdk15on

public static boolean isRsaOid(
  ASN1ObjectIdentifier algOid)
{
  for (int i = 0; i != rsaOids.length; i++)
  {
    if (algOid.equals(rsaOids[i]))
    {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.madgag.spongycastle/pkix

static boolean isRFC2631(ASN1ObjectIdentifier algorithm)
{
  return algorithm.equals(PKCSObjectIdentifiers.id_alg_ESDH) || algorithm.equals(PKCSObjectIdentifiers.id_alg_SSDH);
}

代码示例来源:origin: com.madgag.spongycastle/core

protected ASN1Encodable encodeStringValue(ASN1ObjectIdentifier oid,
    String value) {
  if (oid.equals(dc))
  {
    return new DERIA5String(value);
  }
  else if (oid.equals(c) || oid.equals(serialNumber) || oid.equals(dnQualifier)
    || oid.equals(telephoneNumber))
  {
    return new DERPrintableString(value);
  }
  return super.encodeStringValue(oid, value);
}

代码示例来源:origin: com.madgag.spongycastle/core

public PolicyInformation getPolicyInformation(ASN1ObjectIdentifier policyIdentifier)
{
  for (int i = 0; i != policyInformation.length; i++)
  {
    if (policyIdentifier.equals(policyInformation[i].getPolicyIdentifier()))
    {
       return policyInformation[i];
    }
  }
  return null;
}

代码示例来源:origin: com.madgag.spongycastle/prov

public PrivateKey generatePrivate(PrivateKeyInfo keyInfo)
  throws IOException
{
  ASN1ObjectIdentifier algOid = keyInfo.getPrivateKeyAlgorithm().getAlgorithm();
  if (algOid.equals(X9ObjectIdentifiers.id_ecPublicKey))
  {
    return new BCECPrivateKey(algorithm, keyInfo, configuration);
  }
  else
  {
    throw new IOException("algorithm identifier " + algOid + " in key not recognised");
  }
}

代码示例来源:origin: com.madgag.spongycastle/prov

public PublicKey generatePublic(SubjectPublicKeyInfo keyInfo)
  throws IOException
{
  ASN1ObjectIdentifier algOid = keyInfo.getAlgorithm().getAlgorithm();
  if (algOid.equals(X9ObjectIdentifiers.id_ecPublicKey))
  {
    return new BCECPublicKey(algorithm, keyInfo, configuration);
  }
  else
  {
    throw new IOException("algorithm identifier " + algOid + " in key not recognised");
  }
}

代码示例来源:origin: com.madgag.spongycastle/prov

public PrivateKey generatePrivate(PrivateKeyInfo keyInfo)
  throws IOException
{
  ASN1ObjectIdentifier algOid = keyInfo.getPrivateKeyAlgorithm().getAlgorithm();
  if (algOid.equals(CryptoProObjectIdentifiers.gostR3410_94))
  {
    return new BCGOST3410PrivateKey(keyInfo);
  }
  else
  {
    throw new IOException("algorithm identifier " + algOid + " in key not recognised");
  }
}

代码示例来源:origin: com.madgag/scprov-jdk15on

public PrivateKey generatePrivate(PrivateKeyInfo keyInfo)
  throws IOException
{
  ASN1ObjectIdentifier algOid = keyInfo.getPrivateKeyAlgorithm().getAlgorithm();
  if (algOid.equals(CryptoProObjectIdentifiers.gostR3410_2001))
  {
    return new BCECGOST3410PrivateKey(keyInfo);
  }
  else
  {
    throw new IOException("algorithm identifier " + algOid + " in key not recognised");
  }
}

代码示例来源:origin: com.madgag.spongycastle/pkix

/**
 * Determine whether the message is protected by a password based MAC. Use verify(PKMACBuilder, char[])
 * to verify the message if this method returns true.
 *
 * @return true if protection MAC PBE based, false otherwise.
 */
public boolean hasPasswordBasedMacProtection()
{
  return pkiMessage.getHeader().getProtectionAlg().getAlgorithm().equals(CMPObjectIdentifiers.passwordBasedMac);
}

代码示例来源:origin: com.madgag.spongycastle/pkix

private static void validateInfoFormat(OtherRevocationInfoFormat infoFormat)
{
  if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(infoFormat.getInfoFormat()))
  {
    OCSPResponse resp = OCSPResponse.getInstance(infoFormat.getInfo());
    if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
    {
      throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
    }
  }
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

private static void validateInfoFormat(OtherRevocationInfoFormat infoFormat)
{
  if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(infoFormat.getInfoFormat()))
  {
    OCSPResponse resp = OCSPResponse.getInstance(infoFormat.getInfo());
    if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
    {
      throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
    }
  }
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

/**
 * Determine whether the message is protected by a password based MAC. Use verify(PKMACBuilder, char[])
 * to verify the message if this method returns true.
 *
 * @return true if protection MAC PBE based, false otherwise.
 */
public boolean hasPasswordBasedMacProtection()
{
  return pkiMessage.getHeader().getProtectionAlg().getAlgorithm().equals(CMPObjectIdentifiers.passwordBasedMac);
}

代码示例来源:origin: com.madgag.spongycastle/prov

public boolean equals(Object o)
{
  if (o == this)
  {
    return true;
  }
  if (o instanceof BCXMSSPublicKey)
  {
    BCXMSSPublicKey otherKey = (BCXMSSPublicKey)o;
    return treeDigest.equals(otherKey.treeDigest) && Arrays.areEqual(keyParams.toByteArray(), otherKey.keyParams.toByteArray());
  }
  return false;
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

public PKCS12SafeBagFactory(ContentInfo info)
{
  if (info.getContentType().equals(PKCSObjectIdentifiers.encryptedData))
  {
    throw new IllegalArgumentException("encryptedData requires constructor with decryptor.");
  }
  this.safeBagSeq = ASN1Sequence.getInstance(ASN1OctetString.getInstance(info.getContent()).getOctets());
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

private void initialize(ContentInfo contentInfo)
{
  this.contentInfo = contentInfo;
  if (CMSObjectIdentifiers.timestampedData.equals(contentInfo.getContentType()))
  {
    this.timeStampedData = TimeStampedData.getInstance(contentInfo.getContent());
  }
  else
  {
    throw new IllegalArgumentException("Malformed content - type must be " + CMSObjectIdentifiers.timestampedData.getId());
  }
  util = new TimeStampDataUtil(this.timeStampedData);
}

代码示例来源:origin: com.madgag.spongycastle/pkix

private void initialize(ContentInfo contentInfo)
{
  this.contentInfo = contentInfo;
  if (CMSObjectIdentifiers.timestampedData.equals(contentInfo.getContentType()))
  {
    this.timeStampedData = TimeStampedData.getInstance(contentInfo.getContent());
  }
  else
  {
    throw new IllegalArgumentException("Malformed content - type must be " + CMSObjectIdentifiers.timestampedData.getId());
  }
  util = new TimeStampDataUtil(this.timeStampedData);
}

代码示例来源:origin: com.madgag.spongycastle/pkix

public AlgorithmIdentifier find(AlgorithmIdentifier sigAlgId)
{
  AlgorithmIdentifier digAlgId;
  if (sigAlgId.getAlgorithm().equals(PKCSObjectIdentifiers.id_RSASSA_PSS))
  {
    digAlgId = RSASSAPSSparams.getInstance(sigAlgId.getParameters()).getHashAlgorithm();
  }
  else
  {
    digAlgId = new AlgorithmIdentifier((ASN1ObjectIdentifier)digestOids.get(sigAlgId.getAlgorithm()), DERNull.INSTANCE);
  }
  return digAlgId;
}

代码示例来源:origin: com.madgag.spongycastle/core

public boolean equals(
  Object  o)
{
  if (!(o instanceof Extension))
  {
    return false;
  }
  Extension other = (Extension)o;
  return other.getExtnId().equals(this.getExtnId())
    && other.getExtnValue().equals(this.getExtnValue())
    && (other.isCritical() == this.isCritical());
}

相关文章