directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject directory-kerby git commit: Add the GeneralName test.
Date Fri, 11 Dec 2015 06:58:19 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 4816806a2 -> 10c110c0e


Add the GeneralName test.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/10c110c0
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/10c110c0
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/10c110c0

Branch: refs/heads/master
Commit: 10c110c0eaa4aad6955be5a0b77f04484935095b
Parents: 4816806
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri Dec 11 15:05:01 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri Dec 11 15:05:01 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kerby/cms/TestGeneralName.java   | 47 ++++++++++++++++++++
 1 file changed, 47 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10c110c0/kerby-pkix/src/test/java/org/apache/kerby/cms/TestGeneralName.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/test/java/org/apache/kerby/cms/TestGeneralName.java b/kerby-pkix/src/test/java/org/apache/kerby/cms/TestGeneralName.java
new file mode 100644
index 0000000..46c996d
--- /dev/null
+++ b/kerby-pkix/src/test/java/org/apache/kerby/cms/TestGeneralName.java
@@ -0,0 +1,47 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.cms;
+
+import org.apache.kerby.asn1.Asn1;
+import org.apache.kerby.asn1.util.HexUtil;
+import org.apache.kerby.x509.type.GeneralName;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class TestGeneralName {
+    private static final byte[] ipv4 = HexUtil.hex2bytes("87040a090800");
+
+    @Test
+    public void testIpAddress() throws IOException {
+        try {
+            Asn1.dump(ipv4, true);
+            GeneralName generalName = new GeneralName();
+            //TO BE FIXED
+            //10.9.8.0
+//            generalName.decode(ipv4);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            Assert.fail();
+        }
+    }
+}


Mime
View raw message