diff options
author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-04-18 08:24:30 +0000 |
---|---|---|
committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-04-18 08:24:30 +0000 |
commit | 158e98f59fce25c79e634fdaf1717a0c66567d7d (patch) | |
tree | 2414653fa6b0a481674ec56fe6ee83fcbdd9e84c /libjava/java/security | |
parent | 36e429b84693fa0c8928a7394faf37f7673da500 (diff) | |
download | gcc-158e98f59fce25c79e634fdaf1717a0c66567d7d.tar.gz |
* Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Add new security files.
* java/security/NoSuchAlgorithmException.java,
java/security/MessageDigest.java: New files.
* include/javaprims.h: Add security namespace.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26536 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/security')
-rw-r--r-- | libjava/java/security/MessageDigest.java | 64 | ||||
-rw-r--r-- | libjava/java/security/NoSuchAlgorithmException.java | 22 |
2 files changed, 86 insertions, 0 deletions
diff --git a/libjava/java/security/MessageDigest.java b/libjava/java/security/MessageDigest.java new file mode 100644 index 00000000000..00e946a0047 --- /dev/null +++ b/libjava/java/security/MessageDigest.java @@ -0,0 +1,64 @@ +// MessageDigest.java + +/* Copyright (C) 1999 Cygnus Solutions + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +package java.security; + +// FIXME: This is just a stub for a proper implementation. +public abstract class MessageDigest +{ + private static final byte[] dummy = { 0 }; + + public static MessageDigest getInstance(String algorithm) + throws NoSuchAlgorithmException + { + Object obj; + + try { + obj = Class.forName(algorithm).newInstance(); + } catch (Exception e) { + throw new NoSuchAlgorithmException("algorithm " + + algorithm + + " not available."); + } + + return (MessageDigest) obj; + } + + public void update(byte input) + { + // FIXME + } + + public void update(byte[] input, int offset, int len) + { + // FIXME + } + + public void update(byte[] input) + { + // FIXME + } + + public byte[] digest() + { + return dummy; + } + + public byte[] digest(byte[] input) + { + update(input); + return digest(); + } + + public void reset() + { + // FIXME + } +} diff --git a/libjava/java/security/NoSuchAlgorithmException.java b/libjava/java/security/NoSuchAlgorithmException.java new file mode 100644 index 00000000000..5003a2eeb51 --- /dev/null +++ b/libjava/java/security/NoSuchAlgorithmException.java @@ -0,0 +1,22 @@ +/* Copyright (C) 1999 Cygnus Solutions + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +package java.security; + +public class NoSuchAlgorithmException extends Exception +{ + public NoSuchAlgorithmException() + { + super(); + } + + public NoSuchAlgorithmException(String msg) + { + super(msg); + } +} |