001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.midp.installer;
028:
029: import java.io.IOException;
030: import com.sun.midp.io.j2me.storage.RandomAccessStream;
031:
032: /*
033: import java.io.IOException;
034: import java.io.InputStream;
035: import java.io.ByteArrayOutputStream;
036: import java.io.ByteArrayInputStream;
037: import java.io.DataOutputStream;
038: import java.io.DataInputStream;
039:
040: import java.lang.String;
041: import java.lang.IllegalArgumentException;
042:
043: import java.util.Vector;
044:
045: import javax.microedition.io.Connector;
046: import javax.microedition.io.Connection;
047: import javax.microedition.io.HttpConnection;
048:
049: import javax.microedition.pki.CertificateException;
050:
051: import com.sun.midp.crypto.*;
052:
053: import com.sun.midp.pki.*;
054:
055: import com.sun.midp.io.*;
056:
057: import com.sun.midp.io.j2me.storage.*;
058:
059: import com.sun.midp.publickeystore.*;
060:
061: import com.sun.midp.midletsuite.*;
062:
063: import com.sun.midp.security.*;
064: */
065:
066: /**
067: * Interface that must be implemented by any class that is used to verify
068: * a signature of the midlet suite.
069: */
070: public interface Verifier {
071: /**
072: * MIDlet property for the application signature
073: */
074: public static final String SIG_PROP = "MIDlet-Jar-RSA-SHA1";
075:
076: /**
077: * MIDlet property for the content provider certificates
078: */
079: public static final String CERT_PROP = "MIDlet-Certificate-";
080:
081: /**
082: * Checks to see if the JAD has a signature, but does not verify the
083: * signature.
084: *
085: * @return true if the JAD has a signature
086: */
087: public boolean isJadSigned();
088:
089: /**
090: * Gets the security domain name for this MIDlet Suite from storage.
091: *
092: * @param ca CA of an installed suite
093: *
094: * @return name of the security domain for the MIDlet Suite
095: */
096: public String getSecurityDomainName(String ca);
097:
098: /**
099: * Verifies a Jar. On success set the name of the domain owner in the
100: * install state. Post any error back to the server.
101: *
102: * @param jarStorage System store for applications
103: * @param jarFilename name of the jar to read.
104: *
105: * @exception IOException if any error prevents the reading
106: * of the JAR
107: * @exception InvalidJadException if the JAR is not valid or the
108: * provider certificate is missing
109: */
110: public String[] verifyJar(RandomAccessStream jarStorage,
111: String jarFilename) throws IOException, InvalidJadException;
112: }
|