948 lines
15 KiB
Smali
948 lines
15 KiB
Smali
.class public final Lcom/google/api/client/testing/util/SecurityTestUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "SecurityTestUtils.java"
|
|
|
|
|
|
# annotations
|
|
.annotation build Lcom/google/api/client/util/Beta;
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final ENCODED_PRIVATE_KEY:[B
|
|
|
|
.field private static final ENCODED_PUBLIC_KEY:[B
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const/16 v0, 0x27a
|
|
|
|
new-array v0, v0, [B
|
|
|
|
.line 1
|
|
fill-array-data v0, :array_0
|
|
|
|
sput-object v0, Lcom/google/api/client/testing/util/SecurityTestUtils;->ENCODED_PRIVATE_KEY:[B
|
|
|
|
const/16 v0, 0xa2
|
|
|
|
new-array v0, v0, [B
|
|
|
|
.line 2
|
|
fill-array-data v0, :array_1
|
|
|
|
sput-object v0, Lcom/google/api/client/testing/util/SecurityTestUtils;->ENCODED_PUBLIC_KEY:[B
|
|
|
|
return-void
|
|
|
|
nop
|
|
|
|
:array_0
|
|
.array-data 1
|
|
0x30t
|
|
-0x7et
|
|
0x2t
|
|
0x76t
|
|
0x2t
|
|
0x1t
|
|
0x0t
|
|
0x30t
|
|
0xdt
|
|
0x6t
|
|
0x9t
|
|
0x2at
|
|
-0x7at
|
|
0x48t
|
|
-0x7at
|
|
-0x9t
|
|
0xdt
|
|
0x1t
|
|
0x1t
|
|
0x1t
|
|
0x5t
|
|
0x0t
|
|
0x4t
|
|
-0x7et
|
|
0x2t
|
|
0x60t
|
|
0x30t
|
|
-0x7et
|
|
0x2t
|
|
0x5ct
|
|
0x2t
|
|
0x1t
|
|
0x0t
|
|
0x2t
|
|
-0x7ft
|
|
-0x7ft
|
|
0x0t
|
|
-0x59t
|
|
0x21t
|
|
0x8t
|
|
-0x7ct
|
|
0x6et
|
|
-0x3ct
|
|
0x59t
|
|
0x8t
|
|
-0x3et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t
|
|
-0x49t
|
|
-0x32t
|
|
-0x61t
|
|
0xbt
|
|
-0x17t
|
|
-0x3bt
|
|
-0x6bt
|
|
-0x6bt
|
|
0x53t
|
|
-0x19t
|
|
0xft
|
|
-0x5dt
|
|
-0x15t
|
|
0x2t
|
|
0x3t
|
|
0x1t
|
|
0x0t
|
|
0x1t
|
|
.end array-data
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static newEncodedRsaPrivateKeyBytes()[B
|
|
.locals 1
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/api/client/testing/util/SecurityTestUtils;->ENCODED_PRIVATE_KEY:[B
|
|
|
|
invoke-virtual {v0}, [B->clone()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [B
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static newEncodedRsaPublicKeyBytes()[B
|
|
.locals 1
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/api/client/testing/util/SecurityTestUtils;->ENCODED_PUBLIC_KEY:[B
|
|
|
|
invoke-virtual {v0}, [B->clone()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [B
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static newRsaPrivateKey()Ljava/security/interfaces/RSAPrivateKey;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/security/GeneralSecurityException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {}, Lcom/google/api/client/util/SecurityUtils;->getRsaKeyFactory()Ljava/security/KeyFactory;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
new-instance v1, Ljava/security/spec/PKCS8EncodedKeySpec;
|
|
|
|
sget-object v2, Lcom/google/api/client/testing/util/SecurityTestUtils;->ENCODED_PRIVATE_KEY:[B
|
|
|
|
invoke-direct {v1, v2}, Ljava/security/spec/PKCS8EncodedKeySpec;-><init>([B)V
|
|
|
|
.line 3
|
|
invoke-virtual {v0, v1}, Ljava/security/KeyFactory;->generatePrivate(Ljava/security/spec/KeySpec;)Ljava/security/PrivateKey;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/security/interfaces/RSAPrivateKey;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static newRsaPublicKey()Ljava/security/interfaces/RSAPublicKey;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/security/GeneralSecurityException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {}, Lcom/google/api/client/util/SecurityUtils;->getRsaKeyFactory()Ljava/security/KeyFactory;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
new-instance v1, Ljava/security/spec/X509EncodedKeySpec;
|
|
|
|
sget-object v2, Lcom/google/api/client/testing/util/SecurityTestUtils;->ENCODED_PUBLIC_KEY:[B
|
|
|
|
invoke-direct {v1, v2}, Ljava/security/spec/X509EncodedKeySpec;-><init>([B)V
|
|
|
|
.line 3
|
|
invoke-virtual {v0, v1}, Ljava/security/KeyFactory;->generatePublic(Ljava/security/spec/KeySpec;)Ljava/security/PublicKey;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/security/interfaces/RSAPublicKey;
|
|
|
|
return-object v0
|
|
.end method
|