File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/main/java/com/somemore/global/encoder Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .somemore .global .encoder ;
2+
3+ import org .springframework .security .crypto .bcrypt .BCryptPasswordEncoder ;
4+ import org .springframework .security .crypto .password .PasswordEncoder ;
5+
6+ public class BCryptPasswordEncoderUtil {
7+
8+ private static final PasswordEncoder PASSWORD_ENCODER = new BCryptPasswordEncoder ();
9+
10+ private BCryptPasswordEncoderUtil () {
11+ throw new UnsupportedOperationException ("유틸리티 클래스는 인스턴스화할 수 없습니다." );
12+ }
13+
14+ public static String encode (String rawPassword ) {
15+ return PASSWORD_ENCODER .encode (rawPassword );
16+ }
17+
18+ public static boolean matches (String rawPassword , String encodedPassword ) {
19+ return PASSWORD_ENCODER .matches (rawPassword , encodedPassword );
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments