@Test public void testLineageFromFileContainsExpectedSigners() throws Exception { DataSource lineageDataSource = Resources.toDataSource(getClass(), "rsa-2048-lineage-3-signers"); SigningCertificateLineage lineage = SigningCertificateLineage.readFromDataSource( lineageDataSource); List<SignerConfig> signers = new ArrayList<>(3); signers.add( Resources.toLineageSignerConfig(getClass(), FIRST_RSA_2048_SIGNER_RESOURCE_NAME)); signers.add( Resources.toLineageSignerConfig(getClass(), SECOND_RSA_2048_SIGNER_RESOURCE_NAME)); signers.add( Resources.toLineageSignerConfig(getClass(), THIRD_RSA_2048_SIGNER_RESOURCE_NAME)); assertLineageContainsExpectedSigners(lineage, signers); }
public static SigningCertificateLineage readFromDataSource(DataSource dataSource) throws IOException { if (dataSource == null) { throw new NullPointerException("dataSource == null"); } ByteBuffer inBuff = dataSource.getByteBuffer(0, (int) dataSource.size()); inBuff.order(ByteOrder.LITTLE_ENDIAN); return read(inBuff); }
SigningCertificateLineage { public static SigningCertificateLineage readFromDataSource(DataSource dataSource) throws IOException { if (dataSource == null) { throw new NullPointerException("dataSource == null"); } ByteBuffer inBuff = dataSource.getByteBuffer(0, (int) dataSource.size()); inBuff.order(ByteOrder.LITTLE_ENDIAN); return read(inBuff); } }
SigningCertificateLineage { public static SigningCertificateLineage readFromDataSource(DataSource dataSource) throws IOException { if (dataSource == null) { throw new NullPointerException("dataSource == null"); } ByteBuffer inBuff = dataSource.getByteBuffer(0, (int) dataSource.size()); inBuff.order(ByteOrder.LITTLE_ENDIAN); return read(inBuff); } private  SigningCertificateLineage(int minSdkVersion, List<SigningCertificateNode> list); }
SigningCertificateLineage { public static SigningCertificateLineage readFromDataSource(DataSource dataSource) throws IOException { if (dataSource == null) { throw new NullPointerException("dataSource == null"); } ByteBuffer inBuff = dataSource.getByteBuffer(0, (int) dataSource.size()); inBuff.order(ByteOrder.LITTLE_ENDIAN); return read(inBuff); } private  SigningCertificateLineage(int minSdkVersion, List<SigningCertificateNode> list); static SigningCertificateLineage readFromFile(File file); static SigningCertificateLineage readFromDataSource(DataSource dataSource); static SigningCertificateLineage readFromV3AttributeValue(byte[] attrValue); static SigningCertificateLineage readFromApkFile(File apkFile); static SigningCertificateLineage readFromApkDataSource(DataSource apk); static SigningCertificateLineage readFromSignedData(ByteBuffer signedData); void writeToFile(File file); void writeToDataSink(DataSink dataSink); SigningCertificateLineage spawnDescendant(SignerConfig parent, SignerConfig child); SigningCertificateLineage spawnDescendant(
            SignerConfig parent, SignerConfig child, SignerCapabilities childCapabilities); int size(); byte[] generateV3SignerAttribute(); List<DefaultApkSignerEngine.SignerConfig> sortSignerConfigs(
            List<DefaultApkSignerEngine.SignerConfig> signerConfigs); SignerCapabilities getSignerCapabilities(SignerConfig config); SignerCapabilities getSignerCapabilities(X509Certificate cert); void updateSignerCapabilities(SignerConfig config, SignerCapabilities capabilities); List<X509Certificate> getCertificatesInLineage(); boolean isSignerInLineage(SignerConfig config); boolean isCertificateInLineage(X509Certificate cert); SigningCertificateLineage getSubLineage(X509Certificate x509Certificate); static SigningCertificateLineage consolidateLineages(
            List<SigningCertificateLineage> lineages); }
SigningCertificateLineage { public static SigningCertificateLineage readFromDataSource(DataSource dataSource) throws IOException { if (dataSource == null) { throw new NullPointerException("dataSource == null"); } ByteBuffer inBuff = dataSource.getByteBuffer(0, (int) dataSource.size()); inBuff.order(ByteOrder.LITTLE_ENDIAN); return read(inBuff); } private  SigningCertificateLineage(int minSdkVersion, List<SigningCertificateNode> list); static SigningCertificateLineage readFromFile(File file); static SigningCertificateLineage readFromDataSource(DataSource dataSource); static SigningCertificateLineage readFromV3AttributeValue(byte[] attrValue); static SigningCertificateLineage readFromApkFile(File apkFile); static SigningCertificateLineage readFromApkDataSource(DataSource apk); static SigningCertificateLineage readFromSignedData(ByteBuffer signedData); void writeToFile(File file); void writeToDataSink(DataSink dataSink); SigningCertificateLineage spawnDescendant(SignerConfig parent, SignerConfig child); SigningCertificateLineage spawnDescendant(
            SignerConfig parent, SignerConfig child, SignerCapabilities childCapabilities); int size(); byte[] generateV3SignerAttribute(); List<DefaultApkSignerEngine.SignerConfig> sortSignerConfigs(
            List<DefaultApkSignerEngine.SignerConfig> signerConfigs); SignerCapabilities getSignerCapabilities(SignerConfig config); SignerCapabilities getSignerCapabilities(X509Certificate cert); void updateSignerCapabilities(SignerConfig config, SignerCapabilities capabilities); List<X509Certificate> getCertificatesInLineage(); boolean isSignerInLineage(SignerConfig config); boolean isCertificateInLineage(X509Certificate cert); SigningCertificateLineage getSubLineage(X509Certificate x509Certificate); static SigningCertificateLineage consolidateLineages(
            List<SigningCertificateLineage> lineages); final static int MAGIC; }