Précédent   Forum des professionnels en informatique > Bases de données > Oracle > Outils > Forms
Forms Forum d'entraide sur Oracle Forms
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 26/02/2007, 17h28   #1
Nouveau Membre du Club
 
Avatar de emiscool
 
Inscription : octobre 2006
Messages : 45
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : octobre 2006
Messages : 45
Points : 37
Points : 37
Par défaut [Forms]recherche d'un bean(PJC) pour MD5

Bonjour tout le monde,

je cherche un PJC de cryptage (md5) pour mon application forms,


j ai pas le temps de le programmer ansi que l'alghorithme, svp si qlq un a déja travail sur ce bean,


j ai essais d'utiliser un dll md5, mais j ai pas arrivé.


Merci d'avance,


Cordialement.
emiscool est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/02/2007, 10h09   #2
Membre éclairé
 
Inscription : décembre 2004
Messages : 349
Détails du profil
Informations personnelles :
Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

Informations forums :
Inscription : décembre 2004
Messages : 349
Points : 367
Points : 367
Je n'ai pas testé ce code sous forme de PJC, mais je pense qu'il devrait fonctionner ...

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.td;
 
import oracle.forms.handler.IHandler;
import oracle.forms.properties.ID;
import oracle.forms.ui.*;
import oracle.forms.ui.VBean;
 
import java.security.*;
 
/*
 * Encodage MD5
 * @author Thierry D.
 * d'aprés le code source :
 * 
 */
 
public class EncodeMd5 extends VBean  {
  public EncodeMd5() { 
    super(); 
    // strMD5 = "Salut l'artiste" ;
    // log (getMD5 (strMD5));
  }
 
 private String strMD5 ;
 
 public final static ID SET_MD5_STRING   = ID.registerProperty("SET_MD5_STRING");     
 public final static ID GET_MD5   = ID.registerProperty("GET_MD5");      
 
 private IHandler  m_handler; 
 
  public void init(IHandler handler) { m_handler = handler;
    super.init(handler); 
    log ("________________________________________________");
    log ( m_handler.getApplet().getCodeBase().getHost() + ":" +m_handler.getApplet().getCodeBase().getPort() );
    log ( m_handler.getApplet().getParameter("serverArgs"));
    log ("________________________________________________");
  }      
 
 public BOOLEAN setProperty(ID property, Object value) {  
    IF (property == SET_MD5_STRING){ strMD5 = value.toString();}
    RETURN super.setProperty(property, value);
  }
 
 public Object getProperty(ID pId) {
    IF (pId == GET_MD5)  { RETURN getMD5(strMD5);  }
    RETURN super.getProperty(pId);
 }
 
 
private String getMD5 (String KEY){
  byte[] uniqueKey = KEY.getBytes();
  byte[] hash = NULL;
 
  try { // ON récupère un objet qui permettra de crypter la chaine
       hash = MessageDigest.getInstance("MD5").digest(uniqueKey);
  } catch (NoSuchAlgorithmException e) { throw new Error("no MD5 support in this VM");}
 
  StringBuffer hashString = new StringBuffer();
 
  FOR (int i = 0; i < hash.length; ++i) {
    String hex = Integer.toHexString(hash[i]);
    IF (hex.length() == 1) {
    hashString.append("0");
    hashString.append(hex.charAt(hex.length() - 1));
    } else {hashString.append(hex.substring(hex.length() - 2));}
  }
  RETURN hashString.toString();
}
 
private void log (String temp ){
  System.out.println (temp);
}
 
public static void main (String[] args){
 // EncodeMd5 em5 = new EncodeMd5();
}     
}



pour l'intégration du bean essaies de t'inspirer de ceci.
http://www.developpez.net/forums/sho...6&postcount=14

CDLT.
taska est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/02/2007, 10h18   #3
Nouveau Membre du Club
 
Avatar de emiscool
 
Inscription : octobre 2006
Messages : 45
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : octobre 2006
Messages : 45
Points : 37
Points : 37
Merci taska, tu es très gentil, je vais essai ce code maintenant.



Cordialement.
emiscool est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/02/2007, 11h10   #4
Nouveau Membre du Club
 
Avatar de emiscool
 
Inscription : octobre 2006
Messages : 45
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : octobre 2006
Messages : 45
Points : 37
Points : 37
C est fait, et il marche à Merville, merci infiniment.


emiscool est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/02/2007, 12h42   #5
Membre éclairé
 
Inscription : décembre 2004
Messages : 349
Détails du profil
Informations personnelles :
Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

Informations forums :
Inscription : décembre 2004
Messages : 349
Points : 367
Points : 367
ya pa d'koi ...

... et n'oublies pas de flagguer en [RESOLU] ..

CDLT.
taska est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 08h40.


 
 
 
 
Partenaires

Hébergement Web