org.bouncycastle.asn1.ASN1InputStream.read()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(169)

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

ASN1InputStream.read介绍

暂无

代码示例

代码示例来源:origin: AgNO3/jcifs-ng

public KerberosToken ( byte[] token, KerberosKey[] keys ) throws PACDecodingException {
  if ( token.length <= 0 )
    throw new PACDecodingException("Empty kerberos token");
  try {
    ASN1InputStream stream = new ASN1InputStream(new ByteArrayInputStream(token));
    DERApplicationSpecific derToken = ASN1Util.as(DERApplicationSpecific.class, stream);
    if ( derToken == null || !derToken.isConstructed() )
      throw new PACDecodingException("Malformed kerberos token");
    stream.close();
    stream = new ASN1InputStream(new ByteArrayInputStream(derToken.getContents()));
    ASN1ObjectIdentifier kerberosOid = ASN1Util.as(ASN1ObjectIdentifier.class, stream);
    if ( !kerberosOid.getId().equals(KerberosConstants.KERBEROS_OID) )
      throw new PACDecodingException("Not a kerberos token");
    int read = 0;
    int readLow = stream.read() & 0xff;
    int readHigh = stream.read() & 0xff;
    read = ( readHigh << 8 ) + readLow;
    if ( read != 0x01 )
      throw new PACDecodingException("Malformed kerberos token");
    DERApplicationSpecific krbToken = ASN1Util.as(DERApplicationSpecific.class, stream);
    if ( krbToken == null || !krbToken.isConstructed() )
      throw new PACDecodingException("Malformed kerberos token");
    stream.close();
    this.apRequest = new KerberosApRequest(krbToken.getContents(), keys);
  }
  catch ( IOException e ) {
    throw new PACDecodingException("Malformed kerberos token", e);
  }
}

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

public ASN1Primitive readObject()
  throws IOException
  int tag = read();
  if (tag <= 0)

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

public ASN1Primitive readObject()
  throws IOException
  int tag = read();
  if (tag <= 0)

代码示例来源:origin: org.codelibs/jcifs

public KerberosToken ( byte[] token, KerberosKey[] keys ) throws PACDecodingException {
  if ( token.length <= 0 )
    throw new PACDecodingException("Empty kerberos token");
  try {
    ASN1InputStream stream = new ASN1InputStream(new ByteArrayInputStream(token));
    DERApplicationSpecific derToken = ASN1Util.as(DERApplicationSpecific.class, stream);
    if ( derToken == null || !derToken.isConstructed() )
      throw new PACDecodingException("Malformed kerberos token");
    stream.close();
    stream = new ASN1InputStream(new ByteArrayInputStream(derToken.getContents()));
    ASN1ObjectIdentifier kerberosOid = ASN1Util.as(ASN1ObjectIdentifier.class, stream);
    if ( !kerberosOid.getId().equals(KerberosConstants.KERBEROS_OID) )
      throw new PACDecodingException("Not a kerberos token");
    int read = 0;
    int readLow = stream.read() & 0xff;
    int readHigh = stream.read() & 0xff;
    read = ( readHigh << 8 ) + readLow;
    if ( read != 0x01 )
      throw new PACDecodingException("Malformed kerberos token");
    DERApplicationSpecific krbToken = ASN1Util.as(DERApplicationSpecific.class, stream);
    if ( krbToken == null || !krbToken.isConstructed() )
      throw new PACDecodingException("Malformed kerberos token");
    stream.close();
    this.apRequest = new KerberosApRequest(krbToken.getContents(), keys);
  }
  catch ( IOException e ) {
    throw new PACDecodingException("Malformed kerberos token", e);
  }
}

相关文章