2 * //******************************************************************
4 * // Copyright 2016 Samsung Electronics All Rights Reserved.
6 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8 * // Licensed under the Apache License, Version 2.0 (the "License");
9 * // you may not use this file except in compliance with the License.
10 * // You may obtain a copy of the License at
12 * // http://www.apache.org/licenses/LICENSE-2.0
14 * // Unless required by applicable law or agreed to in writing, software
15 * // distributed under the License is distributed on an "AS IS" BASIS,
16 * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * // See the License for the specific language governing permissions and
18 * // limitations under the License.
20 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 package org.iotivity.cloud.accountserver.x509.crl;
24 import java.io.FileInputStream;
25 import java.io.FileOutputStream;
26 import java.io.InputStream;
28 public final class CrlStore {
31 throw new AssertionError(); // to get rid of security issue, connected
32 // with Java Reflection API
35 private static final String CRL_FILE_NAME = "crl";
37 public static void saveCrl(byte[] crl) {
39 FileOutputStream out = new FileOutputStream(CRL_FILE_NAME);
42 } catch (java.io.IOException e) {
47 public static byte[] loadCrl() {
50 InputStream f = new FileInputStream(CRL_FILE_NAME);
51 int size = f.available();
52 byte data[] = new byte[size];
54 if(f.read(data) != data.length) {
55 System.err.println("couldn't read crl");
60 } catch (java.io.IOException e) {