-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Android): Add TLS key & cert for server (#192)
- Loading branch information
Showing
7 changed files
with
439 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
android/src/main/java/com/asterinet/react/tcpsocket/KeystoreInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.asterinet.react.tcpsocket; | ||
|
||
public class KeystoreInfo { | ||
private String keystoreName; | ||
private String caAlias; | ||
private String certAlias; | ||
private String keyAlias; | ||
|
||
public KeystoreInfo(String keystoreName, String caAlias, String certAlias, String keyAlias) { | ||
this.keystoreName = keystoreName; | ||
this.caAlias = (caAlias == null || caAlias.isEmpty()) ? "ca" : caAlias; | ||
this.certAlias = (certAlias == null || certAlias.isEmpty()) ? "cert" : certAlias; | ||
this.keyAlias = (keyAlias == null || keyAlias.isEmpty()) ? "key" : keyAlias; | ||
} | ||
|
||
public String getKeystoreName() { | ||
return this.keystoreName; | ||
} | ||
|
||
public void setKeystoreName(String keystoreName) { | ||
this.keystoreName = keystoreName; | ||
} | ||
|
||
public String getCaAlias() { | ||
return this.caAlias; | ||
} | ||
|
||
public void setCaAlias(String caAlias) { | ||
this.caAlias = caAlias; | ||
} | ||
|
||
public String getCertAlias() { | ||
return this.certAlias; | ||
} | ||
|
||
public void setCertAlias(String certAlias) { | ||
this.certAlias = certAlias; | ||
} | ||
|
||
public String getKeyAlias() { | ||
return this.keyAlias; | ||
} | ||
|
||
public void setKeyAlias(String keyAlias) { | ||
this.keyAlias = keyAlias; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "KeystoreInfo{" + | ||
"keystoreName='" + this.keystoreName + '\'' + | ||
", caAlias='" + this.caAlias + '\'' + | ||
", certAlias='" + this.certAlias + '\'' + | ||
", keyAlias='" + this.keyAlias + '\'' + | ||
'}'; | ||
} | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
android/src/main/java/com/asterinet/react/tcpsocket/ResolvableOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.asterinet.react.tcpsocket; | ||
|
||
public class ResolvableOption { | ||
private final String value; | ||
private final boolean needsResolution; | ||
|
||
public ResolvableOption(String value, boolean needsResolution) { | ||
this.value = value; | ||
this.needsResolution = needsResolution; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public boolean needsResolution() { | ||
return needsResolution; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.