summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-07-24 17:01:42 (GMT)
committerNick Hudson <nick.hudson@isode.com>2015-08-14 15:32:08 (GMT)
commit0a1f7199e26523dd2693f44a5841c5434cc9000d (patch)
tree8f28ebb20fbe60f420ea25055955ac3d246db549 /src/com/isode/stroke/tls/SimpleCertificate.java
parentdc2b35bee48261e8b06e12bd82a434af118e035e (diff)
downloadstroke-0a1f7199e26523dd2693f44a5841c5434cc9000d.zip
stroke-0a1f7199e26523dd2693f44a5841c5434cc9000d.tar.bz2
Completes TLS & Session.
Adds TLSError and TLSOptions. Updates BasicSessionStream, SessionStream and Session. Updates Client and Components to accomodate changes in TLS. Also completes TLSLayer in StreamStack which was pending due to TLS port. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for Certificate and ServerIdentityVerifier. Test updated for ComponentSession. All tests pass. Change-Id: I34a8fe068c1e8af5348cc4ab49d3d1ed118ae833
Diffstat (limited to 'src/com/isode/stroke/tls/SimpleCertificate.java')
-rw-r--r--src/com/isode/stroke/tls/SimpleCertificate.java78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/com/isode/stroke/tls/SimpleCertificate.java b/src/com/isode/stroke/tls/SimpleCertificate.java
new file mode 100644
index 0000000..178d36d
--- /dev/null
+++ b/src/com/isode/stroke/tls/SimpleCertificate.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+/*
+ * Copyright (c) 2015 Tarun Gupta.
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+package com.isode.stroke.tls;
+
+import java.util.List;
+import java.util.ArrayList;
+import com.isode.stroke.base.ByteArray;
+
+public class SimpleCertificate extends Certificate {
+
+ private String subjectName = "";
+ private ByteArray der = new ByteArray();
+ private List<String> commonNames = new ArrayList<String>();
+ private List<String> dnsNames = new ArrayList<String>();
+ private List<String> xmppAddresses = new ArrayList<String>();
+ private List<String> srvNames = new ArrayList<String>();
+
+ public void setSubjectName(final String name) {
+ subjectName = name;
+ }
+
+ public String getSubjectName() {
+ return subjectName;
+ }
+
+ public List<String> getCommonNames() {
+ return commonNames;
+ }
+
+ public void addCommonName(final String name) {
+ commonNames.add(name);
+ }
+
+ public void addSRVName(final String name) {
+ srvNames.add(name);
+ }
+
+ public void addDNSName(final String name) {
+ dnsNames.add(name);
+ }
+
+ public void addXMPPAddress(final String addr) {
+ xmppAddresses.add(addr);
+ }
+
+ public List<String> getSRVNames() {
+ return srvNames;
+ }
+
+ public List<String> getDNSNames() {
+ return dnsNames;
+ }
+
+ public List<String> getXMPPAddresses() {
+ return xmppAddresses;
+ }
+
+ public ByteArray toDER() {
+ return der;
+ }
+
+ public void setDER(final ByteArray der) {
+ this.der = der;
+ }
+
+ private void parse() {
+
+ }
+} \ No newline at end of file