public static Asn1Object FromByteArray( byte[] data) { try { return new Asn1InputStream(data).ReadObject(); } catch (InvalidCastException) { throw new IOException("cannot recognise object in stream"); } }