Loading keystore/java/android/security/Credentials.java +0 −61 Original line number Diff line number Diff line Loading @@ -16,12 +16,6 @@ package android.security; import android.annotation.UnsupportedAppUsage; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.util.Log; import com.android.org.bouncycastle.util.io.pem.PemObject; import com.android.org.bouncycastle.util.io.pem.PemReader; import com.android.org.bouncycastle.util.io.pem.PemWriter; Loading @@ -34,7 +28,6 @@ import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; import java.nio.charset.StandardCharsets; import java.security.KeyPair; import java.security.cert.Certificate; import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; Loading @@ -53,8 +46,6 @@ public class Credentials { public static final String INSTALL_AS_USER_ACTION = "android.credentials.INSTALL_AS_USER"; public static final String UNLOCK_ACTION = "com.android.credentials.UNLOCK"; /** Key prefix for CA certificates. */ public static final String CA_CERTIFICATE = "CACERT_"; Loading Loading @@ -171,58 +162,6 @@ public class Credentials { } } private static Credentials singleton; @UnsupportedAppUsage public static Credentials getInstance() { if (singleton == null) { singleton = new Credentials(); } return singleton; } @UnsupportedAppUsage public void unlock(Context context) { try { Intent intent = new Intent(UNLOCK_ACTION); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } } public void install(Context context) { try { Intent intent = KeyChain.createInstallIntent(); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } } @UnsupportedAppUsage public void install(Context context, KeyPair pair) { try { Intent intent = KeyChain.createInstallIntent(); intent.putExtra(EXTRA_PRIVATE_KEY, pair.getPrivate().getEncoded()); intent.putExtra(EXTRA_PUBLIC_KEY, pair.getPublic().getEncoded()); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } } @UnsupportedAppUsage public void install(Context context, String type, byte[] value) { try { Intent intent = KeyChain.createInstallIntent(); intent.putExtra(type, value); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } } /** * Delete all types (private key, user certificate, CA certificate) for a * particular {@code alias}. All three can exist for any given alias. Loading Loading
keystore/java/android/security/Credentials.java +0 −61 Original line number Diff line number Diff line Loading @@ -16,12 +16,6 @@ package android.security; import android.annotation.UnsupportedAppUsage; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.util.Log; import com.android.org.bouncycastle.util.io.pem.PemObject; import com.android.org.bouncycastle.util.io.pem.PemReader; import com.android.org.bouncycastle.util.io.pem.PemWriter; Loading @@ -34,7 +28,6 @@ import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; import java.nio.charset.StandardCharsets; import java.security.KeyPair; import java.security.cert.Certificate; import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; Loading @@ -53,8 +46,6 @@ public class Credentials { public static final String INSTALL_AS_USER_ACTION = "android.credentials.INSTALL_AS_USER"; public static final String UNLOCK_ACTION = "com.android.credentials.UNLOCK"; /** Key prefix for CA certificates. */ public static final String CA_CERTIFICATE = "CACERT_"; Loading Loading @@ -171,58 +162,6 @@ public class Credentials { } } private static Credentials singleton; @UnsupportedAppUsage public static Credentials getInstance() { if (singleton == null) { singleton = new Credentials(); } return singleton; } @UnsupportedAppUsage public void unlock(Context context) { try { Intent intent = new Intent(UNLOCK_ACTION); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } } public void install(Context context) { try { Intent intent = KeyChain.createInstallIntent(); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } } @UnsupportedAppUsage public void install(Context context, KeyPair pair) { try { Intent intent = KeyChain.createInstallIntent(); intent.putExtra(EXTRA_PRIVATE_KEY, pair.getPrivate().getEncoded()); intent.putExtra(EXTRA_PUBLIC_KEY, pair.getPublic().getEncoded()); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } } @UnsupportedAppUsage public void install(Context context, String type, byte[] value) { try { Intent intent = KeyChain.createInstallIntent(); intent.putExtra(type, value); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(LOGTAG, e.toString()); } } /** * Delete all types (private key, user certificate, CA certificate) for a * particular {@code alias}. All three can exist for any given alias. Loading