static String getOidFromPkcs8Encoded(byte[] encoded) throws NoSuchAlgorithmException {
		if (encoded == null) {
			throw new NoSuchAlgorithmException("encoding is null");
		}

		try {
			SimpleDERReader reader = new SimpleDERReader(encoded);
			reader.resetInput(reader.readSequenceAsByteArray());
			reader.readInt();
			reader.resetInput(reader.readSequenceAsByteArray());
			return reader.readOid();
		} catch (IOException e) {
			Log.w(TAG, "Could not read OID", e);
			throw new NoSuchAlgorithmException("Could not read key", e);
		}
	}
@Test
	public void getOidFromPkcs8Encoded_Null_Failure() throws Exception {
		try {
			PubkeyUtils.getOidFromPkcs8Encoded(null);
			fail("Should throw NoSuchAlgorithmException");
		} catch (NoSuchAlgorithmException expected) {
		}
	}