Package jcifs.pac

Class ASN1Util


  • public final class ASN1Util
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T as​(Class<T> type, Object object)  
      static <T> T as​(Class<T> type, Enumeration<?> enumeration)  
      static <T extends org.bouncycastle.asn1.ASN1Primitive>
      T
      as​(Class<T> type, org.bouncycastle.asn1.ASN1InputStream stream)  
      static <T extends org.bouncycastle.asn1.ASN1Primitive>
      T
      as​(Class<T> type, org.bouncycastle.asn1.ASN1Sequence sequence, int index)  
      static <T extends org.bouncycastle.asn1.ASN1Primitive>
      T
      as​(Class<T> type, org.bouncycastle.asn1.ASN1TaggedObject tagged)  
      static <T extends org.bouncycastle.asn1.ASN1Primitive>
      T
      as​(Class<T> type, org.bouncycastle.asn1.DLSequence sequence, int index)  
      static byte[] readUnparsedTagged​(int expectTag, int limit, org.bouncycastle.asn1.ASN1InputStream in)
      Read a tagged object without parsing it's contents BC no longer seems to allow that out of the box
    • Method Detail

      • as

        public static <T extends org.bouncycastle.asn1.ASN1Primitive> T as​(Class<T> type,
                                                                           org.bouncycastle.asn1.ASN1TaggedObject tagged)
                                                                    throws PACDecodingException
        Parameters:
        type -
        tagged -
        Returns:
        tagged object contents cast to type
        Throws:
        PACDecodingException
      • as

        public static <T extends org.bouncycastle.asn1.ASN1Primitive> T as​(Class<T> type,
                                                                           org.bouncycastle.asn1.DLSequence sequence,
                                                                           int index)
                                                                    throws PACDecodingException
        Parameters:
        type -
        sequence -
        index -
        Returns:
        sequence element cast to type
        Throws:
        PACDecodingException
      • as

        public static <T extends org.bouncycastle.asn1.ASN1Primitive> T as​(Class<T> type,
                                                                           org.bouncycastle.asn1.ASN1Sequence sequence,
                                                                           int index)
                                                                    throws PACDecodingException
        Parameters:
        type -
        sequence -
        index -
        Returns:
        sequence element cast to type
        Throws:
        PACDecodingException
      • readUnparsedTagged

        public static byte[] readUnparsedTagged​(int expectTag,
                                                int limit,
                                                org.bouncycastle.asn1.ASN1InputStream in)
                                         throws IOException
        Read a tagged object without parsing it's contents BC no longer seems to allow that out of the box
        Parameters:
        expectTag -
        in -
        Returns:
        coded bytes of the tagged object
        Throws:
        IOException