samples/messagedigest/src-new-api/org/apidesign/spi/security/Digestor.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:52:25 +0200
changeset 47 f464a16d553a
child 152 eb6f29070331
permissions -rw-r--r--
Simplified to does not contain the friend API, instead the SPI is directly define by the API
jtulach@47
     1
/*
jtulach@47
     2
 * To change this template, choose Tools | Templates
jtulach@47
     3
 * and open the template in the editor.
jtulach@47
     4
 */
jtulach@47
     5
jtulach@47
     6
package org.apidesign.spi.security;
jtulach@47
     7
jtulach@47
     8
import java.nio.ByteBuffer;
jtulach@47
     9
jtulach@47
    10
/**
jtulach@47
    11
 *
jtulach@47
    12
 * @author  Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jtulach@47
    13
 */
jtulach@47
    14
// BEGIN: day.end.bridges.Digestor
jtulach@47
    15
public abstract class Digestor<Data> {
jtulach@47
    16
   protected abstract byte[] digest(Data data);
jtulach@47
    17
   protected abstract Data create(String algorithm); 
jtulach@47
    18
   protected abstract void update(Data data, ByteBuffer input);
jtulach@47
    19
   
jtulach@47
    20
// END: day.end.bridges.Digestor   
jtulach@47
    21
   
jtulach@47
    22
   
jtulach@47
    23
   static {
jtulach@47
    24
       // initializes the accessor, so the api package can call protected
jtulach@47
    25
       // methods from this class
jtulach@47
    26
       new DigestorAccessorImpl();
jtulach@47
    27
   }
jtulach@47
    28
}
jtulach@47
    29